mirror of
https://github.com/postgres/postgres.git
synced 2025-11-15 03:41:20 +03:00
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.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.275 2009/09/01 02:54:51 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.276 2009/11/23 09:58:36 heikki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1856,6 +1856,7 @@ PrepareTransaction(void)
|
||||
AtPrepare_Inval();
|
||||
AtPrepare_Locks();
|
||||
AtPrepare_PgStat();
|
||||
AtPrepare_MultiXact();
|
||||
|
||||
/*
|
||||
* Here is where we really truly prepare.
|
||||
@@ -1909,7 +1910,7 @@ PrepareTransaction(void)
|
||||
|
||||
PostPrepare_smgr();
|
||||
|
||||
AtEOXact_MultiXact();
|
||||
PostPrepare_MultiXact(xid);
|
||||
|
||||
PostPrepare_Locks(xid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user