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

Commit a0acd7b

Browse files
knizhnikkelvich
authored andcommitted
Use MtmIsBroadcast to prevent recursion in MtmProcessDDLCommand
1 parent 535eae1 commit a0acd7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

multimaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,9 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
877877
}
878878
if (!TransactionIdIsValid(gtid->xid)) {
879879
/* In case of recovery InvalidTransactionId is passed */
880-
Assert(Mtm->status == MTM_RECOVERY);
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]);
882+
}
881883
} else if (Mtm->status == MTM_RECOVERY) {
882884
/* When recovery is completed we get normal transaction ID and switch to normal mode */
883885
MtmRecoveryCompleted();
@@ -2340,7 +2342,7 @@ static bool MtmProcessDDLCommand(char const* queryString)
23402342
rel = heap_openrv_extended(rv, RowExclusiveLock, true);
23412343

23422344
if (rel == NULL) {
2343-
if (!IsTransactionBlock()) {
2345+
if (!MtmIsBroadcast()) {
23442346
MtmBroadcastUtilityStmt(queryString, false);
23452347
return true;
23462348
}

0 commit comments

Comments
 (0)