diff options
author | Michael P | 2011-03-02 00:46:21 +0000 |
---|---|---|
committer | Pavan Deolasee | 2011-05-19 17:49:39 +0000 |
commit | 9bf28d03c9ca4f8a791b5e455f77b39d092dfa6c (patch) | |
tree | 9cd60b1ffc75eb822a85994e707ec0ac107e6dbe /src/include | |
parent | 20e88ee4c8cd85092891ed5b3bec36820018323f (diff) |
Fix for bug 3134395, 3086422, 3136230: 2PC locks
When a PREPARE was being made on Coordinator for a transaction not
using DDL, 2PC file was bypassed so as to make a fake COMMIT on Coordinator.
The problem was that locks hold at PREPARE state were not released at COMMIT
PREPARED on Coordinator because lock information was obtained from 2PC,
which indeed did not exist on Coordinator for non-DDL transactions.
With this fix, instead of a fake PREPARE, XC does a Commit on Coordinator
without contacting GTM, this permits to release correctly all the locks
held by transaction.
PrepareTransaction is simplified in xact.c, but CommitTransaction
needs an additional parameter to decide if GTM is called at COMMIT
or not.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/twophase.h | 6 | ||||
-rw-r--r-- | src/include/access/xact.h | 6 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/include/access/twophase.h b/src/include/access/twophase.h index 58bc7e4d43..8261ee7620 100644 --- a/src/include/access/twophase.h +++ b/src/include/access/twophase.h @@ -36,13 +36,7 @@ extern GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid, TimestampTz prepared_at, Oid owner, Oid databaseid); -#ifdef PGXC -extern void RemoveGXactCoord(GlobalTransaction gxact); -extern void EndPrepare(GlobalTransaction gxact, bool write_2pc_file); -#else extern void EndPrepare(GlobalTransaction gxact); -#endif - extern void StartPrepare(GlobalTransaction gxact); extern TransactionId PrescanPreparedTransactions(void); diff --git a/src/include/access/xact.h b/src/include/access/xact.h index d211329bd3..6ff489ff7d 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -172,12 +172,12 @@ extern void AbortCurrentTransactionOnce(void); #endif extern void AbortCurrentTransaction(void); extern void BeginTransactionBlock(void); -extern bool EndTransactionBlock(void); #ifdef PGXC -extern bool PrepareTransactionBlock(char *gid, bool write_2pc_file); +extern bool EndTransactionBlock(bool contact_gtm); #else -extern bool PrepareTransactionBlock(char *gid); +extern bool EndTransactionBlock(void); #endif +extern bool PrepareTransactionBlock(char *gid); extern void UserAbortTransactionBlock(void); extern void ReleaseSavepoint(List *options); extern void DefineSavepoint(char *name); |