diff options
| author | Michael P | 2011-03-30 11:25:52 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2011-05-24 10:15:38 +0000 |
| commit | 12a24a40765d64691ec2ac7d5dbcc561b3806b9f (patch) | |
| tree | 14228b80ee6699c79e7029be706da8477246a9ae | |
| parent | 1e1dc8653b58622fd2531defc585facc114df0f5 (diff) | |
Fix GXID feed issue
Useless calls to GetCurrentTransactionId were the origin
of consuming extra transaction IDs even on backend Datanode
where it should ot take a transaction ID at some moments.
This problem may cause node crash, due to same transaction IDs being committed
twice or pooler connection issues.
| -rw-r--r-- | src/backend/access/transam/xact.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 4466d2ccb6..724e2a156f 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1899,13 +1899,16 @@ CommitTransaction(bool contact_gtm) bool PrepareLocalCoord = false; bool PreparePGXCNodes = false; char implicitgid[256]; - TransactionId xid = GetCurrentTransactionId(); + TransactionId xid = InvalidTransactionId; if (IS_PGXC_COORDINATOR && !IsConnFromCoord() && contact_gtm) PreparePGXCNodes = PGXCNodeIsImplicit2PC(&PrepareLocalCoord); if (PrepareLocalCoord || PreparePGXCNodes) + { + xid = GetCurrentTransactionId(); sprintf(implicitgid, "T%d", xid); + } /* Save GID where PrepareTransaction can find it again */ if (PrepareLocalCoord) |
