8000 Fix thinko introduced in 2bef06d516460 et al. · dirbacke/postgres@d687425 · GitHub
[go: up one dir, main page]

Skip to content

Commit d687425

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 23a2b81 commit d687425

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
@@ -327,7 +327,7 @@ CreateInitDecodingContext(char *plugin,
327327
*/
328328
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
329329

330-
xmin_horizon = GetOldestSafeDecodingTransactionId(need_full_snapshot);
330+
xmin_horizon = GetOldestSafeDecodingTransactionId(!need_full_snapshot);
331331

332332
slot->effective_catalog_xmin = xmin_horizon;
333333
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
@@ -595,7 +595,7 @@ SnapBuildExportSnapshot(SnapBuild *builder)
595595
TransactionId safeXid;
596596

597597
LWLockAcquire(ProcArrayLock, LW_SHARED);
598-
safeXid = GetOldestSafeDecodingTransactionId(true);
598+
safeXid = GetOldestSafeDecodingTransactionId(false);
599599
LWLockRelease(ProcArrayLock);
600600

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

0 commit comments

Comments
 (0)
0