Skip to content

Commit 7a88fe9

Browse files
knizhnikkelvich
authored andcommitted
Fix oldest xid adjustment algorithm
1 parent 43ccb59 commit 7a88fe9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

multimaster.c

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

348348

349349
TransactionId MtmGetOldestXmin(Relation rel, bool ignoreVacuum)
350350
{
351-
TransactionId xmin = PgGetOldestXmin(NULL, ignoreVacuum); /* consider all backends */
351+
TransactionId xmin = PgGetOldestXmin(NULL, false); /* consider all backends */
352352
xmin = MtmAdjustOldestXid(xmin);
353353
return xmin;
354354
}
@@ -539,7 +539,8 @@ MtmAdjustOldestXid(TransactionId xid)
539539
if (prev != NULL) {
540540
Mtm->transListHead = prev;
541541
Mtm->oldestXid = xid = prev->xid;
542-
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
542+
} else {
543+
Assert(TransactionIdPrecedesOrEqual(Mtm->oldestXid, xid));
543544
xid = Mtm->oldestXid;
544545
}
545546
} 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