synchronized snapshots
От
Joachim Wieland
Тема
synchronized snapshots
Дата
Msg-id
CACw0+12Bvv=dshD84AEPoBkzTG=K1Z-7vQnbXuhzxdYOOo+==A@mail.gmail.com
Список
Дерево обсуждения
synchronized snapshots Joachim Wieland <joe@mcknight.de>
Re: synchronized snapshots Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: synchronized snapshots Joachim Wieland <joe@mcknight.de>
Re: synchronized snapshots Jim Nasby <jim@nasby.net>
Re: synchronized snapshots Joachim Wieland <joe@mcknight.de>
Re: synchronized snapshots Jim Nasby <jim@nasby.net>
Re: synchronized snapshots Jeff Davis <pgsql@j-davis.com>
Re: synchronized snapshots Jim Nasby <jim@nasby.net>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Jeff Davis <pgsql@j-davis.com>
Re: synchronized snapshots Peter Eisentraut <peter_e@gmx.net>
Re: synchronized snapshots Bruce Momjian <bruce@momjian.us>
Re: synchronized snapshots Peter Eisentraut <peter_e@gmx.net>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots Jeff Davis <pgsql@j-davis.com>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots Alvaro Herrera <alvherre@commandprompt.com>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots Simon Riggs <simon@2ndQuadrant.com>
Re: synchronized snapshots PostgreSQL - Hans-Jürgen Schönig<postgres@cybertec.at>
Re: synchronized snapshots Andres Freund <andres@anarazel.de>
Re: synchronized snapshots Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: synchronized snapshots Florian Weimer <fweimer@bfk.de>
Re: synchronized snapshots Joachim Wieland <joe@mcknight.de>
Re: synchronized snapshots Joachim Wieland <joe@mcknight.de>
Re: synchronized snapshots Marko Tiikkaja <marko.tiikkaja@2ndquadrant.com>
Re: synchronized snapshots Joachim Wieland <joe@mcknight.de>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: synchronized snapshots Florian Pflug <fgp@phlo.org>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Robert Haas <robertmhaas@gmail.com>
Re: synchronized snapshots "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: synchronized snapshots Florian Pflug <fgp@phlo.org>
Re: synchronized snapshots "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Thom Brown <thom@linux.com>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Thom Brown <thom@linux.com>
Re: synchronized snapshots Marko Tiikkaja <marko.tiikkaja@2ndquadrant.com>
Re: synchronized snapshots Simon Riggs <simon@2ndQuadrant.com>
Re: synchronized snapshots Tom Lane <tgl@sss.pgh.pa.us>
Re: synchronized snapshots Simon Riggs <simon@2ndQuadrant.com>
Re: synchronized snapshots Joachim Wieland <joe@mcknight.de>
This is a patch to implement synchronized snapshots. It is based on Alvaro's specifications in: http://archives.postgresql.org/pgsql-hackers/2011-02/msg02074.php In short, this is how it works: SELECT pg_export_snapshot(); pg_export_snapshot -------------------- 000003A1-1 (1 row) (and then in a different session) BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ (SNAPSHOT = '000003A1-1'); The one thing that it does not implement is leaving the transaction in an aborted state if the BEGIN TRANSACTION command failed for an invalid snapshot identifier. I can certainly see that this would be useful but I am not sure if it justifies introducing this inconsistency. We would have a BEGIN TRANSACTION command that left the session in a different state depending on why it failed... Also I was unsure if we really need to do further checking beyond the existence of the file, why exactly is this necessary? The patch is adding an extra "stemplate" parameter to the GetSnapshot functions, the primary reason for this is to make it work with SSI, which gets a snapshot and then does stuff with it. The alternative would have been splitting up the SSI function so that we can smuggle in our own snapshot but that didn't seem to be less ugly. The way it works now is that the lowest function checks if a template is being passed from higher up and if so, it doesn't get a fresh snapshot but returns just a copy of the template. I am wondering if pg_export_snapshot() is still the right name, since the snapshot is no longer exported to the user. It is exported to a file but that's an implementation detail. Joachim
В списке pgsql-hackers по дате отправления