Skip to content

Commit 258bbce

Browse files
committed
reorderbuffer fix
1 parent f27755b commit 258bbce

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,10 +1320,6 @@ ReorderBufferCommitInternal(ReorderBufferTXN *txn,
13201320
bool using_subtxn;
13211321
ReorderBufferIterTXNState *volatile iterstate = NULL;
13221322

1323-
/* unknown transaction, nothing to replay */
1324-
if (txn == NULL)
1325-
return;
1326-
13271323
txn->final_lsn = commit_lsn;
13281324
txn->end_lsn = end_lsn;
13291325
txn->commit_time = commit_time;
@@ -1700,6 +1696,10 @@ ReorderBufferCommit(ReorderBuffer *rb, TransactionId xid,
17001696
txn = ReorderBufferTXNByXid(rb, xid, false, NULL, InvalidXLogRecPtr,
17011697
false);
17021698

1699+
/* unknown transaction, nothing to replay */
1700+
if (txn == NULL)
1701+
return;
1702+
17031703
ReorderBufferCommitInternal(txn, rb, xid, commit_lsn, end_lsn,
17041704
commit_time, origin_id, origin_lsn);
17051705
}
@@ -1720,6 +1720,10 @@ ReorderBufferPrepare(ReorderBuffer *rb, TransactionId xid,
17201720
txn = ReorderBufferTXNByXid(rb, xid, false, NULL, InvalidXLogRecPtr,
17211721
false);
17221722

1723+
/* unknown transaction, nothing to replay */
1724+
if (txn == NULL)
1725+
return;
1726+
17231727
txn->prepared = true;
17241728
strcpy(txn->gid, gid);
17251729

0 commit comments

Comments
 (0)