Skip to content

Commit 161379e

Browse files
committed
Allow skipping transactions for ReorderBufferAbortOld()
Transactions need to be marked as RBTXN_DISTR_SKIP_CLEANUP to be skipped in ReorderBufferAbortOld().
1 parent 730c382 commit 161379e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2992,7 +2992,8 @@ ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid)
29922992

29932993
txn = dlist_container(ReorderBufferTXN, node, it.cur);
29942994

2995-
if (TransactionIdPrecedes(txn->xid, oldestRunningXid))
2995+
if (!(txn->txn_flags & RBTXN_DISTR_SKIP_CLEANUP) &&
2996+
TransactionIdPrecedes(txn->xid, oldestRunningXid))
29962997
{
29972998
elog(DEBUG2, "aborting old transaction %u", txn->xid);
29982999

src/include/replication/reorderbuffer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ typedef struct ReorderBufferChange
187187
#define RBTXN_SKIPPED_PREPARE 0x0080
188188
#define RBTXN_HAS_STREAMABLE_CHANGE 0x0100
189189
#define RBTXN_DISTR_INVAL_OVERFLOWED 0x0200
190+
#define RBTXN_DISTR_SKIP_CLEANUP 0x0400
190191

191192
/* Does the transaction have catalog changes? */
192193
#define rbtxn_has_catalog_changes(txn) \

0 commit comments

Comments
 (0)