@@ -878,7 +878,7 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
878878if (!TransactionIdIsValid (gtid -> xid )) {
879879/* In case of recovery InvalidTransactionId is passed */
880880if (Mtm -> status != MTM_RECOVERY ) {
881- elog (PANIC ,"Node %d tries to recover node %d which is in %s mode" ,MtmReplicationNode ,MtmNodeId ,MtmNodeStatusMnem [Mtm -> status ]);
881+ elog (PANIC ,"Node %d tries to recover node %d which is in %s mode" ,MtmReplicationNodeId ,MtmNodeId ,MtmNodeStatusMnem [Mtm -> status ]);
882882}
883883}else if (Mtm -> status == MTM_RECOVERY ) {
884884/* When recovery is completed we get normal transaction ID and switch to normal mode */
@@ -2164,20 +2164,21 @@ Datum mtm_dump_lock_graph(PG_FUNCTION_ARGS)
21642164{
21652165size_t size ;
21662166char * data = RaftableGet (psprintf ("lock-graph-%d" ,i + 1 ),& size ,NULL , true);
2167- if (!data )continue ;
2168- GlobalTransactionId * gtid = (GlobalTransactionId * )data ;
2169- GlobalTransactionId * last = (GlobalTransactionId * )(data + size );
2170- appendStringInfo (s ,"node-%d lock graph: " ,i + 1 );
2171- while (gtid != last ) {
2172- GlobalTransactionId * src = gtid ++ ;
2173- appendStringInfo (s ,"%d:%d -> " ,src -> node ,src -> xid );
2174- while (gtid -> node != 0 ) {
2175- GlobalTransactionId * dst = gtid ++ ;
2176- appendStringInfo (s ,"%d:%d, " ,dst -> node ,dst -> xid );
2167+ if (data ) {
2168+ GlobalTransactionId * gtid = (GlobalTransactionId * )data ;
2169+ GlobalTransactionId * last = (GlobalTransactionId * )(data + size );
2170+ appendStringInfo (s ,"node-%d lock graph: " ,i + 1 );
2171+ while (gtid != last ) {
2172+ GlobalTransactionId * src = gtid ++ ;
2173+ appendStringInfo (s ,"%d:%d -> " ,src -> node ,src -> xid );
2174+ while (gtid -> node != 0 ) {
2175+ GlobalTransactionId * dst = gtid ++ ;
2176+ appendStringInfo (s ,"%d:%d, " ,dst -> node ,dst -> xid );
2177+ }
2178+ gtid += 1 ;
21772179}
2178- gtid += 1 ;
2180+ appendStringInfo ( s , "\n" ) ;
21792181}
2180- appendStringInfo (s ,"\n" );
21812182}
21822183return CStringGetTextDatum (s -> data );
21832184}