mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-06 09:59:20 +02:00
Fix thinko introduced in 2bef06d516
et al.
The callers for GetOldestSafeDecodingTransactionId() all inverted the argument for the argument introduced in2bef06d516
. 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-, where2bef06d516
was backpatched to.
This commit is contained in:
parent
f27449fcca
commit
32d7480e02
@ -284,7 +284,7 @@ CreateInitDecodingContext(char *plugin,
|
|||||||
*/
|
*/
|
||||||
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
|
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
|
||||||
|
|
||||||
xmin_horizon = GetOldestSafeDecodingTransactionId(need_full_snapshot);
|
xmin_horizon = GetOldestSafeDecodingTransactionId(!need_full_snapshot);
|
||||||
|
|
||||||
slot->effective_catalog_xmin = xmin_horizon;
|
slot->effective_catalog_xmin = xmin_horizon;
|
||||||
slot->data.catalog_xmin = xmin_horizon;
|
slot->data.catalog_xmin = xmin_horizon;
|
||||||
|
@ -592,7 +592,7 @@ SnapBuildExportSnapshot(SnapBuild *builder)
|
|||||||
TransactionId safeXid;
|
TransactionId safeXid;
|
||||||
|
|
||||||
LWLockAcquire(ProcArrayLock, LW_SHARED);
|
LWLockAcquire(ProcArrayLock, LW_SHARED);
|
||||||
safeXid = GetOldestSafeDecodingTransactionId(true);
|
safeXid = GetOldestSafeDecodingTransactionId(false);
|
||||||
LWLockRelease(ProcArrayLock);
|
LWLockRelease(ProcArrayLock);
|
||||||
|
|
||||||
Assert(TransactionIdPrecedesOrEquals(safeXid, snap->xmin));
|
Assert(TransactionIdPrecedesOrEquals(safeXid, snap->xmin));
|
||||||
|
Loading…
Reference in New Issue
Block a user