pgsql: Fix an old bug in multixact and two-phase commit.

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix an old bug in multixact and two-phase commit.
Date: 2009-11-23 09:59:21
Message-ID: 20091123095921.EA196753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix an old bug in multixact and two-phase commit. Prepared transactions can
be part of multixacts, so allocate a slot for each prepared transaction in
the "oldest member" array in multixact.c. On PREPARE TRANSACTION, transfer
the oldest member value from the current backends slot to the prepared xact
slot. Also save and recover the value from the 2pc state file.

The symptom of the bug was that after a transaction prepared, a shared lock
still held by the prepared transaction was sometimes ignored by other
transactions.

Fix back to 8.1, where both 2PC and multixact were introduced.

Tags:
----
REL8_1_STABLE

Modified Files:
--------------
pgsql/src/backend/access/transam:
multixact.c (r1.11.2.3 -> r1.11.2.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/multixact.c?r1=1.11.2.3&r2=1.11.2.4)
twophase.c (r1.16.2.3 -> r1.16.2.4)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/twophase.c?r1=1.16.2.3&r2=1.16.2.4)
twophase_rmgr.c (r1.2 -> r1.2.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/twophase_rmgr.c?r1=1.2&r2=1.2.2.1)
xact.c (r1.215.2.4 -> r1.215.2.5)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xact.c?r1=1.215.2.4&r2=1.215.2.5)
pgsql/src/include/access:
multixact.h (r1.7.2.1 -> r1.7.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/multixact.h?r1=1.7.2.1&r2=1.7.2.2)
twophase.h (r1.6 -> r1.6.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/twophase.h?r1=1.6&r2=1.6.2.1)
twophase_rmgr.h (r1.2 -> r1.2.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/twophase_rmgr.h?r1=1.2&r2=1.2.2.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2009-11-23 11:45:48 Re: Re: [COMMITTERS] pgsql: Remove -w (--ignore-all-space) option from pg_regress's diff
Previous Message Heikki Linnakangas 2009-11-23 09:59:11 pgsql: Fix an old bug in multixact and two-phase commit.