@@ -878,7 +878,7 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
878
878
if (!TransactionIdIsValid (gtid -> xid )) {
879
879
/* In case of recovery InvalidTransactionId is passed */
880
880
if (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 ]);
882
882
}
883
883
} else if (Mtm -> status == MTM_RECOVERY ) {
884
884
/* 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)
2164
2164
{
2165
2165
size_t size ;
2166
2166
char * 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 ;
2177
2179
}
2178
- gtid += 1 ;
2180
+ appendStringInfo ( s , "\n" ) ;
2179
2181
}
2180
- appendStringInfo (s , "\n" );
2181
2182
}
2182
2183
return CStringGetTextDatum (s -> data );
2183
2184
}
0 commit comments