Extend CLog, Subtrans log and CommitTsLog appropriately when an XID is received
authorPavan Deolasee <pavan.deolasee@gmail.com>
Wed, 4 May 2016 18:36:26 +0000 (00:06 +0530)
committerPavan Deolasee <pavan.deolasee@gmail.com>
Wed, 4 May 2016 18:36:26 +0000 (00:06 +0530)
from a remote node

src/backend/access/transam/xact.c

index 7986aa75eab75b448c4fc9dfce9b632f855d6aa4..2a14c3cc1b0ebe9f17989ba6e83e2a4a3aa51bc6 100644 (file)
@@ -6792,6 +6792,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;