Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e62c700

Browse files
knizhnikkelvich
authored andcommitted
Fix compile bug in MtmJoinTransaction
1 parent 4378dd7 commit e62c700

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

multimaster.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
878878
if (!TransactionIdIsValid(gtid->xid)) {
879879
/* In case of recovery InvalidTransactionId is passed */
880880
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]);
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
{
21652165
size_t size;
21662166
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;
21772179
}
2178-
gtid += 1;
2180+
appendStringInfo(s, "\n");
21792181
}
2180-
appendStringInfo(s, "\n");
21812182
}
21822183
return CStringGetTextDatum(s->data);
21832184
}

0 commit comments

Comments
 (0)