Skip to content

Commit 3057a01

Browse files
committed
Fix oldest xid adjustment algorithm
1 parent 6750490 commit 3057a01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contrib/mmts/multimaster.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ csn_t MtmTransactionSnapshot(TransactionId xid)
342342
Snapshot MtmGetSnapshot(Snapshot snapshot)
343343
{
344344
snapshot = PgGetSnapshotData(snapshot);
345-
RecentGlobalDataXmin = RecentGlobalXmin = MtmAdjustOldestXid(RecentGlobalDataXmin);
345+
RecentGlobalDataXmin = RecentGlobalXmin = Mtm->oldestXid;//MtmAdjustOldestXid(RecentGlobalDataXmin);
346346
return snapshot;
347347
}
348348

349349

350350
TransactionId MtmGetOldestXmin(Relation rel, bool ignoreVacuum)
351351
{
352-
TransactionId xmin = PgGetOldestXmin(NULL, ignoreVacuum); /* consider all backends */
352+
TransactionId xmin = PgGetOldestXmin(NULL, false); /* consider all backends */
353353
xmin = MtmAdjustOldestXid(xmin);
354354
return xmin;
355355
}
@@ -540,7 +540,8 @@ MtmAdjustOldestXid(TransactionId xid)
540540
if (prev != NULL) {
541541
Mtm->transListHead = prev;
542542
Mtm->oldestXid = xid = prev->xid;
543-
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
543+
} else {
544+
Assert(TransactionIdPrecedesOrEqual(Mtm->oldestXid, xid));
544545
xid = Mtm->oldestXid;
545546
}
546547
} else {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy