@@ -367,14 +367,16 @@ DtmAdjustOldestXid()
367
367
}
368
368
369
369
static void
370
- DtmInitGlobalXmin (TransactionId xid )
370
+ DtmInitGlobalXmin (TransactionId xmin )
371
371
{
372
372
TransactionId current_xmin ;
373
373
374
+ Assert (TransactionIdIsValid (xmin ));
375
+
374
376
/* Better change to CAS */
375
377
current_xmin = ProcArrayGetGlobalSnapshotXmin ();
376
378
if (!TransactionIdIsValid (current_xmin ))
377
- ProcArraySetGlobalSnapshotXmin (xid );
379
+ ProcArraySetGlobalSnapshotXmin (xmin );
378
380
}
379
381
380
382
@@ -515,7 +517,7 @@ DtmLocalExtend(GlobalTransactionId gtid)
515
517
SpinLockRelease (& local -> lock );
516
518
}
517
519
x -> is_global = true;
518
- DtmInitGlobalXmin (x -> xid );
520
+ DtmInitGlobalXmin (TransactionXmin );
519
521
return x -> snapshot ;
520
522
}
521
523
@@ -549,7 +551,7 @@ DtmLocalAccess(DtmCurrentTrans * x, GlobalTransactionId gtid, cid_t global_cid)
549
551
{
550
552
elog (ERROR ,"Too old snapshot: requested %ld, current %ld" ,global_cid ,local_cid );
551
553
}
552
- DtmInitGlobalXmin (x -> xid );
554
+ DtmInitGlobalXmin (TransactionXmin );
553
555
return global_cid ;
554
556
}
555
557