]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix an old bug in multixact and two-phase commit. Prepared transactions can
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 23 Nov 2009 09:59:11 +0000 (09:59 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 23 Nov 2009 09:59:11 +0000 (09:59 +0000)
commit26a13b72421f6d54077db23200326536ece2cf7c
tree890d117f7806119ff1b676573a0505a802ab6cb7
parent22452fa96f6c748f72da039f5b24787f1f3f1484
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.
src/backend/access/transam/multixact.c
src/backend/access/transam/twophase.c
src/backend/access/transam/twophase_rmgr.c
src/backend/access/transam/xact.c
src/include/access/multixact.h
src/include/access/twophase.h
src/include/access/twophase_rmgr.h