@@ -1414,6 +1414,8 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
1414
1414
MtmTransMap * tm ;
1415
1415
MtmTransState * ts ;
1416
1416
1417
+ MTM_TXTRACE (x , "MtmPreCommitPreparedTransaction Start" );
1418
+
1417
1419
if (Mtm -> status == MTM_RECOVERY || x -> isReplicated || x -> isPrepared ) { /* Ignore auto-2PC originated by multimaster */
1418
1420
return ;
1419
1421
}
@@ -1447,12 +1449,17 @@ MtmPreCommitPreparedTransaction(MtmCurrentTrans* x)
1447
1449
x -> isPrepared = true;
1448
1450
}
1449
1451
MtmUnlock ();
1452
+
1453
+ MTM_TXTRACE (x , "MtmPreCommitPreparedTransaction Finish" );
1450
1454
}
1451
1455
1452
1456
static void
1453
1457
MtmAbortPreparedTransaction (MtmCurrentTrans * x )
1454
1458
{
1455
1459
MtmTransMap * tm ;
1460
+
1461
+ MTM_TXTRACE (x , "MtmAbortPreparedTransaction Start" );
1462
+
1456
1463
if (x -> status != TRANSACTION_STATUS_ABORTED ) {
1457
1464
MtmLock (LW_EXCLUSIVE );
1458
1465
tm = (MtmTransMap * )hash_search (MtmGid2State , x -> gid , HASH_FIND , NULL );
@@ -1472,6 +1479,8 @@ MtmAbortPreparedTransaction(MtmCurrentTrans* x)
1472
1479
} else {
1473
1480
MTM_LOG1 ("Transaction %s (%llu) is already aborted" , x -> gid , (long64 )x -> xid );
1474
1481
}
1482
+
1483
+ MTM_TXTRACE (x , "MtmAbortPreparedTransaction Finish" );
1475
1484
}
1476
1485
1477
1486
static void
@@ -1495,6 +1504,8 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
1495
1504
MyProcPid , (long64 )x -> xid , x -> isPrepared , x -> isReplicated , x -> isDistributed , x -> isTwoPhase , x -> gid , commit ? "commit" : "abort" , (long64 )GetXLogInsertRecPtr ());
1496
1505
commit &= (x -> status != TRANSACTION_STATUS_ABORTED );
1497
1506
1507
+ MTM_TXTRACE (x , "MtmEndTransaction Start (c=%d)" , commit );
1508
+
1498
1509
MtmLock (LW_EXCLUSIVE );
1499
1510
1500
1511
MtmStopTransaction ();
@@ -1591,6 +1602,8 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
1591
1602
}
1592
1603
MtmUnlock ();
1593
1604
1605
+ MTM_TXTRACE (x , "MtmEndTransaction Finish" );
1606
+
1594
1607
MtmResetTransaction ();
1595
1608
if (MtmClusterLocked ) {
1596
1609
MtmUnlockCluster ();
@@ -4537,6 +4550,8 @@ MtmGenerateGid(char* gid)
4537
4550
*/
4538
4551
static bool MtmTwoPhaseCommit (MtmCurrentTrans * x )
4539
4552
{
4553
+ MTM_TXTRACE (x , "MtmTwoPhaseCommit Start" );
4554
+
4540
4555
if (!x -> isReplicated && x -> isDistributed && x -> containsDML ) {
4541
4556
MtmGenerateGid (x -> gid );
4542
4557
if (!x -> isTransactionBlock ) {
@@ -4564,6 +4579,7 @@ static bool MtmTwoPhaseCommit(MtmCurrentTrans* x)
4564
4579
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 );
4565
4580
} else {
4566
4581
FinishPreparedTransaction (x -> gid , true);
4582
+ MTM_TXTRACE (x , "MtmTwoPhaseCommit Committed" );
4567
4583
MTM_LOG2 ("Distributed transaction %s (%lld) is committed at %lld with LSN=%lld" , x -> gid , (long64 )x -> xid , MtmGetCurrentTime (), (long64 )GetXLogInsertRecPtr ());
4568
4584
}
4569
4585
}
0 commit comments