@@ -707,7 +707,8 @@ MtmCreateTransState(MtmCurrentTrans* x)
707707 /* I am coordinator of transaction */
708708 ts -> gtid .xid = x -> xid ;
709709 ts -> gtid .node = MtmNodeId ;
710- ts -> gid [0 ] = '\0' ;
710+ //ts->gid[0] = '\0';
711+ strcpy (ts -> gid , x -> gid );
711712 }
712713 return ts ;
713714}
@@ -723,6 +724,7 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
723724{
724725 MtmTransState * ts ;
725726 TransactionId * subxids ;
727+ MTM_TXTRACE (x , "PrePrepareTransaction Start" );
726728
727729 if (!x -> isDistributed ) {
728730 return ;
@@ -781,7 +783,8 @@ MtmPrePrepareTransaction(MtmCurrentTrans* x)
781783 MtmAddSubtransactions (ts , subxids , ts -> nSubxids );
782784 MTM_LOG3 ("%d: MtmPrePrepareTransaction prepare commit of %d (gtid.xid=%d, gtid.node=%d, CSN=%ld)" ,
783785 MyProcPid , x -> xid , ts -> gtid .xid , ts -> gtid .node , ts -> csn );
784- MtmUnlock ();
786+ MtmUnlock ();
787+ MTM_TXTRACE (x , "PrePrepareTransaction Finish" );
785788}
786789
787790/*
@@ -809,6 +812,7 @@ static void
809812MtmPostPrepareTransaction (MtmCurrentTrans * x )
810813{
811814 MtmTransState * ts ;
815+ MTM_TXTRACE (x , "PostPrepareTransaction Start" );
812816
813817 if (Mtm -> inject2PCError == 2 ) {
814818 Mtm -> inject2PCError = 0 ;
@@ -844,7 +848,9 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
844848 while (!ts -> votingCompleted && Mtm -> status == MTM_ONLINE && ts -> status != TRANSACTION_STATUS_ABORTED && start + transTimeout >= MtmGetSystemTime ())
845849 {
846850 MtmUnlock ();
851+ MTM_TXTRACE (x , "PostPrepareTransaction WaitLatch Start" );
847852 result = WaitLatch (& MyProc -> procLatch , WL_LATCH_SET |WL_TIMEOUT , MtmHeartbeatRecvTimeout );
853+ MTM_TXTRACE (x , "PostPrepareTransaction WaitLatch Finish" );
848854 if (result & WL_LATCH_SET ) {
849855 ResetLatch (& MyProc -> procLatch );
850856 }
@@ -867,6 +873,8 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
867873 Mtm -> inject2PCError = 0 ;
868874 elog (ERROR , "ERROR INJECTION for transaction %d (%s)" , x -> xid , x -> gid );
869875 }
876+
877+ MTM_TXTRACE (x , "PostPrepareTransaction Finish" );
870878}
871879
872880
@@ -1063,8 +1071,9 @@ csn_t MtmGetTransactionCSN(TransactionId xid)
10631071}
10641072
10651073void MtmWakeUpBackend (MtmTransState * ts )
1066- {
1067- if (!ts -> votingCompleted ) {
1074+ {
1075+ if (!ts -> votingCompleted ) {
1076+ MTM_TXTRACE (ts , "MtmWakeUpBackend" );
10681077 MTM_LOG3 ("Wakeup backed procno=%d, pid=%d" , ts -> procno , ProcGlobal -> allProcs [ts -> procno ].pid );
10691078 ts -> votingCompleted = true;
10701079 SetLatch (& ProcGlobal -> allProcs [ts -> procno ].procLatch );
0 commit comments