Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 32d7480

Browse files
committed
Fix thinko introduced in 2bef06d et al.
The callers for GetOldestSafeDecodingTransactionId() all inverted the argument for the argument introduced in 2bef06d. Luckily this appears to be inconsequential for the moment, as we wait for concurrent in-progress transaction when assembling a snapshot. Additionally this could only make a difference when adding a second logical slot, because only a pre-existing slot could cause an issue by lowering the returned xid dangerously much. Reported-By: Antonin Houska Discussion: https://postgr.es/m/32704.1496993134@localhost Backport: 9.4-, where 2bef06d was backpatched to.
1 parent f27449f commit 32d7480

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/replication/logical/logical.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ CreateInitDecodingContext(char *plugin,
284284
*/
285285
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
286286

287-
xmin_horizon = GetOldestSafeDecodingTransactionId(need_full_snapshot);
287+
xmin_horizon = GetOldestSafeDecodingTransactionId(!need_full_snapshot);
288288

289289
slot->effective_catalog_xmin = xmin_horizon;
290290
slot->data.catalog_xmin = xmin_horizon;

src/backend/replication/logical/snapbuild.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ SnapBuildExportSnapshot(SnapBuild *builder)
592592
TransactionId safeXid;
593593

594594
LWLockAcquire(ProcArrayLock, LW_SHARED);
595-
safeXid = GetOldestSafeDecodingTransactionId(true);
595+
safeXid = GetOldestSafeDecodingTransactionId(false);
596596
LWLockRelease(ProcArrayLock);
597597

598598
Assert(TransactionIdPrecedesOrEquals(safeXid, snap->xmin));

0 commit comments

Comments
 (0)