pgsql: Fix snapshot management, take two.

From: alvherre(at)postgresql(dot)org (Alvaro Herrera)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix snapshot management, take two.
Date: 2009-10-07 16:27:18
Message-ID: 20091007162718.ECD9A753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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(at)mail(dot)gmail(dot)com

Modified Files:
--------------
pgsql/src/backend/commands:
portalcmds.c (r1.80 -> r1.81)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c?r1=1.80&r2=1.81)
pgsql/src/backend/utils/time:
snapmgr.c (r1.11 -> r1.12)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/time/snapmgr.c?r1=1.11&r2=1.12)
pgsql/src/include/utils:
snapmgr.h (r1.6 -> r1.7)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/snapmgr.h?r1=1.6&r2=1.7)
pgsql/src/test/regress/expected:
triggers.out (r1.26 -> r1.27)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/triggers.out?r1=1.26&r2=1.27)
pgsql/src/test/regress/sql:
triggers.sql (r1.15 -> r1.16)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/triggers.sql?r1=1.15&r2=1.16)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2009-10-07 16:27:29 pgsql: Fix snapshot management, take two.
Previous Message Peter Eisentraut 2009-10-06 20:00:44 pgsql: Clean up the clean rules of the documentation Most things should