Extend CLog, Subtrans log and CommitTsLog appropriately when an XID is received
authorPavan Deolasee <[email protected]>
Wed, 4 May 2016 18:36:26 +0000 (00:06 +0530)
committerPavan Deolasee <[email protected]>
Tue, 18 Oct 2016 10:05:06 +0000 (15:35 +0530)
from a remote node

src/backend/access/transam/xact.c

index dba183c772ee4347ee64d81cfd25ecbbfe464912..0a9fdec132eac91db9968704640164a130caa1f1 100644 (file)
@@ -6774,6 +6774,15 @@ SetTopTransactionId(GlobalTransactionId xid)
        Assert(!GlobalTransactionIdIsValid(s->transactionId) ||
                        GlobalTransactionIdEquals(s->transactionId, xid));
 
+       /*
+        * Also extend the CLOG, SubtransLog and CommitTsLog to ensure that this
+        * XID can later be referenced correctly
+        *
+        * Normally this happens in the GetNextLocalTransactionId() path, but that
+        * may not be ever called when XID is received from the remote node
+        */
+       ExtendLogs(xid);
+
        if (!IsConnFromDatanode())
        {
                XactTopTransactionId = s->transactionId = xid;