@@ -242,7 +242,7 @@ dtm_xact_callback(XactEvent event, void *arg)
242
242
DtmLocalCommitPrepared (& dtm_tx );
243
243
break ;
244
244
245
- case XACT_EVENT_PREPARE :
245
+ case XACT_EVENT_PRE_PREPARE :
246
246
DtmLocalSavePreparedState (& dtm_tx );
247
247
DtmLocalEnd (& dtm_tx );
248
248
break ;
@@ -488,8 +488,6 @@ DtmLocalBegin(DtmCurrentTrans * x)
488
488
{
489
489
SpinLockAcquire (& local -> lock );
490
490
// x->xid = GetCurrentTransactionIdIfAny();
491
- x -> xid = GetCurrentTransactionId ();
492
- // Assert(TransactionIdIsValid(x->xid));
493
491
x -> cid = INVALID_CID ;
494
492
x -> is_global = false;
495
493
x -> is_prepared = false;
@@ -653,8 +651,8 @@ DtmLocalEndPrepare(GlobalTransactionId gtid, cid_t cid)
653
651
void
654
652
DtmLocalCommitPrepared (DtmCurrentTrans * x )
655
653
{
656
- // if (!x->is_global )
657
- // return;
654
+ if (!x -> gtid [ 0 ] )
655
+ return ;
658
656
659
657
Assert (x -> gtid != NULL );
660
658
@@ -727,8 +725,8 @@ DtmLocalCommit(DtmCurrentTrans * x)
727
725
void
728
726
DtmLocalAbortPrepared (DtmCurrentTrans * x )
729
727
{
730
- // if (!x->is_global )
731
- // return;
728
+ if (!x -> gtid [ 0 ] )
729
+ return ;
732
730
733
731
Assert (x -> gtid != NULL );
734
732
@@ -752,8 +750,8 @@ DtmLocalAbortPrepared(DtmCurrentTrans * x)
752
750
void
753
751
DtmLocalAbort (DtmCurrentTrans * x )
754
752
{
755
- // if (!x->is_global )
756
- // return;
753
+ if (!TransactionIdIsValid ( x -> xid ) )
754
+ return ;
757
755
758
756
SpinLockAcquire (& local -> lock );
759
757
{
@@ -861,6 +859,7 @@ DtmLocalSavePreparedState(DtmCurrentTrans * x)
861
859
TransactionId * subxids ;
862
860
int nSubxids = xactGetCommittedChildren (& subxids );
863
861
862
+ id -> xid = GetCurrentTransactionId ();
864
863
if (nSubxids != 0 )
865
864
{
866
865
id -> subxids = (TransactionId * ) malloc (nSubxids * sizeof (TransactionId ));
0 commit comments