From 12899ff189f81a59f35f6c3fd967135cb8ee450f Mon Sep 17 00:00:00 2001 From: Georgy Shelkovy Date: Tue, 5 May 2026 10:02:46 +0500 Subject: [PATCH] Resolve conflicts in xact.h, xactdesc.c, twophase.c, and partially in xact.c. 1) Commit 3941eb6 in src/include/access/xact.h changed the include utils/datetime.h to datatype/timestamp.h, while earlier commit 8ae22d1 had already added the include storage/dbdirnode.h in the same location. 2) Commit c55040c in src/include/access/xact.h added a new define XLOG_XACT_INVALIDATIONS, while earlier commit 8ae22d1 had already added the defines XLOG_XACT_DISTRIBUTED_COMMIT and XLOG_XACT_DISTRIBUTED_FORGET in the same location. 3) Commit c55040c added handling for the new XLOG_XACT_INVALIDATIONS define in the xact_desc and xact_identify functions in src/backend/access/rmgrdesc/xactdesc.c. Earlier commit 8ae22d1 had already added handling for the XLOG_XACT_DISTRIBUTED_COMMIT and XLOG_XACT_DISTRIBUTED_FORGET defines in the same locations. 4) Commit 0bead9a added the declaration of the new IsSubTransactionAssignmentPending and MarkSubTransactionAssigned functions in src/include/access/xact.h. Earlier commit 24e2740 had already added the definition of the RecordDistributedForgetCommitted function in the same location. 5) Commit d28ab91 removed the bool forceSync argument from the XactLogCommitRecord function definition in src/include/access/xact.h, while commit 19cd1cf had already added two arguments, int ndeldbs and DbDirNode *deldbs, to the same function definition. 6) Commit d28ab91 removed the false argument from the RecordTransactionCommitPrepared function in src/backend/access/transam/twophase.c when calling XactLogCommitRecord, while commit 19cd1cf had already added two arguments, ndeldbs and deldbs, to the same location. 7) Commit d28ab91 in src/backend/access/transam/xact.c removed the forceSyncCommit argument in the RecordTransactionCommit function when calling the XactLogCommitRecord function, while the earlier commit 19cd1cf had already added two arguments, ndeldbs and deldbs, to the same location. 8) Commit d28ab91 in src/backend/access/transam/xact.c removed the bool forceSync argument in the XactLogCommitRecord function, while the earlier commit 19cd1cf had already added two arguments, int ndeldbs and DbDirNode *deldbs, to the same location. --- src/backend/access/rmgrdesc/xactdesc.c | 24 +++++++++------------ src/backend/access/transam/twophase.c | 4 ---- src/backend/access/transam/xact.c | 8 ------- src/include/access/xact.h | 29 ++++++-------------------- 4 files changed, 16 insertions(+), 49 deletions(-) diff --git a/src/backend/access/rmgrdesc/xactdesc.c b/src/backend/access/rmgrdesc/xactdesc.c index cf8ad0bf5bac..d981c6a8610b 100644 --- a/src/backend/access/rmgrdesc/xactdesc.c +++ b/src/backend/access/rmgrdesc/xactdesc.c @@ -490,7 +490,13 @@ xact_desc(StringInfo buf, XLogReaderState *record) appendStringInfo(buf, "xtop %u: ", xlrec->xtop); xact_desc_assignment(buf, xlrec); } -<<<<<<< HEAD + else if (info == XLOG_XACT_INVALIDATIONS) + { + xl_xact_invals *xlrec = (xl_xact_invals *) rec; + + standby_desc_invalidations(buf, xlrec->nmsgs, xlrec->msgs, InvalidOid, + InvalidOid, false); + } else if (info == XLOG_XACT_DISTRIBUTED_COMMIT) { xl_xact_commit *xlrec = (xl_xact_commit *) rec; @@ -505,14 +511,6 @@ xact_desc(StringInfo buf, XLogReaderState *record) appendStringInfo(buf, "distributed forget "); xact_desc_distributed_forget(buf, xlrec); -======= - else if (info == XLOG_XACT_INVALIDATIONS) - { - xl_xact_invals *xlrec = (xl_xact_invals *) rec; - - standby_desc_invalidations(buf, xlrec->nmsgs, xlrec->msgs, InvalidOid, - InvalidOid, false); ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 } } @@ -541,16 +539,14 @@ xact_identify(uint8 info) case XLOG_XACT_ASSIGNMENT: id = "ASSIGNMENT"; break; -<<<<<<< HEAD + case XLOG_XACT_INVALIDATIONS: + id = "INVALIDATION"; + break; case XLOG_XACT_DISTRIBUTED_COMMIT: id = "DISTRIBUTED_COMMIT"; break; case XLOG_XACT_DISTRIBUTED_FORGET: id = "DISTRIBUTED_FORGET"; -======= - case XLOG_XACT_INVALIDATIONS: - id = "INVALIDATION"; ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 break; } diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 701a07729807..c9411a4277c7 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -2383,12 +2383,8 @@ RecordTransactionCommitPrepared(TransactionId xid, GetPendingTablespaceForDeletionForCommit(), nchildren, children, nrels, rels, ninvalmsgs, invalmsgs, -<<<<<<< HEAD ndeldbs, deldbs, - initfileinval, false, -======= initfileinval, ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK, xid, gid); diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index a35642dd590a..c2b8721fae1a 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -1661,12 +1661,8 @@ RecordTransactionCommit(void) GetPendingTablespaceForDeletionForCommit(), nchildren, children, nrels, rels, nmsgs, invalMessages, -<<<<<<< HEAD ndeldbs, deldbs, - RelcacheInitFileInval, forceSyncCommit, -======= RelcacheInitFileInval, ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 MyXactFlags, InvalidTransactionId, NULL /* plain commit */ ); @@ -6797,12 +6793,8 @@ XactLogCommitRecord(TimestampTz commit_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileNodePendingDelete *rels, int nmsgs, SharedInvalidationMessage *msgs, -<<<<<<< HEAD int ndeldbs, DbDirNode *deldbs, - bool relcacheInval, bool forceSync, -======= bool relcacheInval, ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 int xactflags, TransactionId twophase_xid, const char *twophase_gid) { diff --git a/src/include/access/xact.h b/src/include/access/xact.h index dcc71e2d94d1..2e548245b18d 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -21,11 +21,7 @@ #include "nodes/pg_list.h" #include "storage/relfilenode.h" #include "storage/sinval.h" -<<<<<<< HEAD #include "storage/dbdirnode.h" -#include "utils/datetime.h" -======= ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 #include "cdb/cdbpublic.h" #include "cdb/cdbtm.h" @@ -161,20 +157,16 @@ typedef void (*SubXactCallback) (SubXactEvent event, SubTransactionId mySubid, #define XLOG_XACT_COMMIT_PREPARED 0x30 #define XLOG_XACT_ABORT_PREPARED 0x40 #define XLOG_XACT_ASSIGNMENT 0x50 -<<<<<<< HEAD -/* GPDB takes the last available three opcodes */ -#define XLOG_XACT_DISTRIBUTED_COMMIT 0x60 -#define XLOG_XACT_DISTRIBUTED_FORGET 0x70 -======= #define XLOG_XACT_INVALIDATIONS 0x60 -/* free opcode 0x70 */ ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 +/* GPDB takes the last available three opcodes */ +#define XLOG_XACT_DISTRIBUTED_COMMIT 0x70 +#define XLOG_XACT_DISTRIBUTED_FORGET 0x80 /* mask for filtering opcodes out of xl_info */ -#define XLOG_XACT_OPMASK 0x70 +#define XLOG_XACT_OPMASK 0x80 /* does this record have a 'xinfo' field or not */ -#define XLOG_XACT_HAS_INFO 0x80 +#define XLOG_XACT_HAS_INFO 0x90 /* * The following flags, stored in xinfo, determine which information is @@ -508,12 +500,9 @@ extern void UnregisterXactCallbackOnce(XactCallback callback, void *arg); extern void RegisterSubXactCallback(SubXactCallback callback, void *arg); extern void UnregisterSubXactCallback(SubXactCallback callback, void *arg); -<<<<<<< HEAD extern void RecordDistributedForgetCommitted(DistributedTransactionId gxid); -======= extern bool IsSubTransactionAssignmentPending(void); extern void MarkSubTransactionAssigned(void); ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 extern int xactGetCommittedChildren(TransactionId **ptr); @@ -522,15 +511,9 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time, int nsubxacts, TransactionId *subxacts, int nrels, RelFileNodePendingDelete *rels, int nmsgs, SharedInvalidationMessage *msgs, -<<<<<<< HEAD int ndeldbs, DbDirNode *deldbs, - bool relcacheInval, bool forceSync, - int xactflags, TransactionId twophase_xid, -======= - bool relcacheInval, - int xactflags, + bool relcacheInval, int xactflags, TransactionId twophase_xid, ->>>>>>> d259afa7365165760004c2fdbe2520a94ddf2600 const char *twophase_gid); extern XLogRecPtr XactLogAbortRecord(TimestampTz abort_time,