@@ -1413,6 +1413,8 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
1413
1413
MtmTransMap * tm ;
1414
1414
MtmTransState * ts ;
1415
1415
1416
+ MTM_TXTRACE (x , "MtmPreCommitPreparedTransaction Start" );
1417
+
1416
1418
if (Mtm -> status == MTM_RECOVERY || x -> isReplicated || x -> isPrepared ) { /* Ignore auto-2PC originated by multimaster */
1417
1419
return ;
1418
1420
}
@@ -1446,12 +1448,17 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
1446
1448
x -> isPrepared = true;
1447
1449
}
1448
1450
MtmUnlock ();
1451
+
1452
+ MTM_TXTRACE (x , "MtmPreCommitPreparedTransaction Finish" );
1449
1453
}
1450
1454
1451
1455
static void
1452
1456
MtmAbortPreparedTransaction (MtmCurrentTrans * x )
1453
1457
{
1454
1458
MtmTransMap * tm ;
1459
+
1460
+ MTM_TXTRACE (x , "MtmAbortPreparedTransaction Start" );
1461
+
1455
1462
if (x -> status != TRANSACTION_STATUS_ABORTED ) {
1456
1463
MtmLock (LW_EXCLUSIVE );
1457
1464
tm = (MtmTransMap * )hash_search (MtmGid2State , x -> gid , HASH_FIND , NULL );
@@ -1471,6 +1478,8 @@ MtmAbortPreparedTransaction(MtmCurrentTrans* x)
1471
1478
} else {
1472
1479
MTM_LOG1 ("Transaction %s (%llu) is already aborted" , x -> gid , (long64 )x -> xid );
1473
1480
}
1481
+
1482
+ MTM_TXTRACE (x , "MtmAbortPreparedTransaction Finish" );
1474
1483
}
1475
1484
1476
1485
static void
@@ -1494,6 +1503,8 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
1494
1503
MyProcPid , (long64 )x -> xid , x -> isPrepared , x -> isReplicated , x -> isDistributed , x -> isTwoPhase , x -> gid , commit ? "commit" : "abort" , (long64 )GetXLogInsertRecPtr ());
1495
1504
commit &= (x -> status != TRANSACTION_STATUS_ABORTED );
1496
1505
1506
+ MTM_TXTRACE (x , "MtmEndTransaction Start (c=%d)" , commit );
1507
+
1497
1508
MtmLock (LW_EXCLUSIVE );
1498
1509
1499
1510
MtmStopTransaction ();
@@ -1590,6 +1601,8 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
1590
1601
}
1591
1602
MtmUnlock ();
1592
1603
1604
+ MTM_TXTRACE (x , "MtmEndTransaction Finish" );
1605
+
1593
1606
MtmResetTransaction ();
1594
1607
if (MtmClusterLocked ) {
1595
1608
MtmUnlockCluster ();
@@ -4541,6 +4554,8 @@ MtmGenerateGid(char* gid)
4541
4554
*/
4542
4555
static bool MtmTwoPhaseCommit (MtmCurrentTrans * x )
4543
4556
{
4557
+ MTM_TXTRACE (x , "MtmTwoPhaseCommit Start" );
4558
+
4544
4559
if (!x -> isReplicated && x -> isDistributed && x -> containsDML ) {
4545
4560
MtmGenerateGid (x -> gid );
4546
4561
if (!x -> isTransactionBlock ) {
@@ -4568,6 +4583,7 @@ static bool MtmTwoPhaseCommit(MtmCurrentTrans* x)
4568
4583
MTM_ELOG (ERROR , "Transaction %s (%llu) is aborted on node %d. Check its log to see error details." , x -> gid , (long64 )x -> xid , ts -> abortedByNode );
4569
4584
} else {
4570
4585
FinishPreparedTransaction (x -> gid , true);
4586
+ MTM_TXTRACE (x , "MtmTwoPhaseCommit Committed" );
4571
4587
MTM_LOG2 ("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld" , x -> gid , (long64 )x -> xid , MtmGetCurrentTime (), (long64 )GetXLogInsertRecPtr ());
4572
4588
}
4573
4589
}
0 commit comments