pgsql: Fix snapshot management, take two. - Mailing list pgsql-committers

From alvherre@postgresql.org (Alvaro Herrera)
Subject pgsql: Fix snapshot management, take two.
Date
Msg-id 20091007162729.25037753FB7@cvs.postgresql.org
Whole thread Raw
List 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@mail.gmail.com

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/commands:
        portalcmds.c (r1.79.2.1 -> r1.79.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c?r1=1.79.2.1&r2=1.79.2.2)
    pgsql/src/backend/utils/time:
        snapmgr.c (r1.10.2.1 -> r1.10.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/time/snapmgr.c?r1=1.10.2.1&r2=1.10.2.2)
    pgsql/src/include/utils:
        snapmgr.h (r1.5.2.1 -> r1.5.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/snapmgr.h?r1=1.5.2.1&r2=1.5.2.2)
    pgsql/src/test/regress/expected:
        triggers.out (r1.26 -> r1.26.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/triggers.out?r1=1.26&r2=1.26.2.1)
    pgsql/src/test/regress/sql:
        triggers.sql (r1.15 -> r1.15.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/triggers.sql?r1=1.15&r2=1.15.2.1)

pgsql-committers by date:

Previous
From: alvherre@postgresql.org (Alvaro Herrera)
Date:
Subject: pgsql: Fix snapshot management, take two.
Next
From: alvherre@postgresql.org (Alvaro Herrera)
Date:
Subject: pgsql: Make it possibly to specify GUC params per user and per database.