Skip to content

Commit ce2e104

Browse files
committed
fixup for previous commit
1 parent b9e89b5 commit ce2e104

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/access/transam/global_snapshot.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,16 @@ DtmAdjustOldestXid()
367367
}
368368

369369
static void
370-
DtmInitGlobalXmin(TransactionId xid)
370+
DtmInitGlobalXmin(TransactionId xmin)
371371
{
372372
TransactionId current_xmin;
373373

374+
Assert(TransactionIdIsValid(xmin));
375+
374376
/* Better change to CAS */
375377
current_xmin = ProcArrayGetGlobalSnapshotXmin();
376378
if (!TransactionIdIsValid(current_xmin))
377-
ProcArraySetGlobalSnapshotXmin(xid);
379+
ProcArraySetGlobalSnapshotXmin(xmin);
378380
}
379381

380382

@@ -515,7 +517,7 @@ DtmLocalExtend(GlobalTransactionId gtid)
515517
SpinLockRelease(&local->lock);
516518
}
517519
x->is_global = true;
518-
DtmInitGlobalXmin(x->xid);
520+
DtmInitGlobalXmin(TransactionXmin);
519521
return x->snapshot;
520522
}
521523

@@ -549,7 +551,7 @@ DtmLocalAccess(DtmCurrentTrans * x, GlobalTransactionId gtid, cid_t global_cid)
549551
{
550552
elog(ERROR, "Too old snapshot: requested %ld, current %ld", global_cid, local_cid);
551553
}
552-
DtmInitGlobalXmin(x->xid);
554+
DtmInitGlobalXmin(TransactionXmin);
553555
return global_cid;
554556
}
555557

0 commit comments

Comments
 (0)