aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-08-05 20:52:53 -0700
committerAndres Freund <andres@anarazel.de>2017-08-06 14:21:25 -0700
commitd68742562ca48decbad57adf0014aaed788ce372 (patch)
tree2f317103001db34fc89532ffa1b93c194e8352e6
parent23a2b818f50ff9e1beb73c31cd902a2140476c30 (diff)
downloadpostgresql-d68742562ca48decbad57adf0014aaed788ce372.tar.gz
postgresql-d68742562ca48decbad57adf0014aaed788ce372.zip
Fix thinko introduced in 2bef06d516460 et al.
The callers for GetOldestSafeDecodingTransactionId() all inverted the argument for the argument introduced in 2bef06d516460. 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 2bef06d516460 was backpatched to.
-rw-r--r--src/backend/replication/logical/logical.c2
-rw-r--r--src/backend/replication/logical/snapbuild.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c
index 6a570d0e810..3745edb445d 100644
--- a/src/backend/replication/logical/logical.c
+++ b/src/backend/replication/logical/logical.c
@@ -327,7 +327,7 @@ CreateInitDecodingContext(char *plugin,
*/
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
- xmin_horizon = GetOldestSafeDecodingTransactionId(need_full_snapshot);
+ xmin_horizon = GetOldestSafeDecodingTransactionId(!need_full_snapshot);
slot->effective_catalog_xmin = xmin_horizon;
slot->data.catalog_xmin = xmin_horizon;
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 9359fc2386d..03ca4ba6f61 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -595,7 +595,7 @@ SnapBuildExportSnapshot(SnapBuild *builder)
TransactionId safeXid;
LWLockAcquire(ProcArrayLock, LW_SHARED);
- safeXid = GetOldestSafeDecodingTransactionId(true);
+ safeXid = GetOldestSafeDecodingTransactionId(false);
LWLockRelease(ProcArrayLock);
Assert(TransactionIdPrecedesOrEquals(safeXid, snap->xmin));