]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix snapshot management, take two.
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 7 Oct 2009 16:27:29 +0000 (16:27 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 7 Oct 2009 16:27:29 +0000 (16:27 +0000)
commit4c7ac1aea74fbb37f39cbb25e8fbfcd1966d6d0e
tree40b3dd117acf9719f06fdf7158971866d16c2c54
parent8e3384e35df25479371fb196ec49e58c7940a5a6
Fix snapshot management, take two.

Partially revert the previous patch I installed and replace it with a more
general fix: any time a snapshot is pushed as Active, we need to ensure that it
will not be modified in the future.  This means that if the same snapshot is
used as CurrentSnapshot, it needs to be copied separately.  This affects
serializable transactions only, because CurrentSnapshot has already been copied
by RegisterSnapshot and so PushActiveSnapshot does not think it needs another
copy.  However, CommandCounterIncrement would modify CurrentSnapshot, whereas
ActiveSnapshots must not have their command counters incremented.

I say "partially" because the regression test I added for the previous bug
has been kept.

(This restores 8.3 behavior, because before snapmgr.c existed, any snapshot set
as Active was copied.)

Per bug report from Stuart Bishop in
6bc73d4c0910042358k3d1adff3qa36f8df75198ecea@mail.gmail.com
src/backend/commands/portalcmds.c
src/backend/utils/time/snapmgr.c
src/include/utils/snapmgr.h
src/test/regress/expected/triggers.out
src/test/regress/sql/triggers.sql