Skip to content

Commit ea73b2b

Browse files
committed
Use MtmIsBroadcast to prevent recursion in MtmProcessDDLCommand
1 parent f4ff5be commit ea73b2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/mmts/multimaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,9 @@ void MtmJoinTransaction(GlobalTransactionId* gtid, csn_t globalSnapshot)
874874
}
875875
if (!TransactionIdIsValid(gtid->xid)) {
876876
/* In case of recovery InvalidTransactionId is passed */
877-
Assert(Mtm->status == MTM_RECOVERY);
877+
if (Mtm->status != MTM_RECOVERY) {
878+
elog(PANIC, "Node %d tries to recover node %d which is in %s mode", MtmReplicationNode, MtmNodeId, MtmNodeStatusMnem[Mtm->status]);
879+
}
878880
} else if (Mtm->status == MTM_RECOVERY) {
879881
/* When recovery is completed we get normal transaction ID and switch to normal mode */
880882
MtmRecoveryCompleted();
@@ -2303,7 +2305,7 @@ static bool MtmProcessDDLCommand(char const* queryString)
23032305
rel = heap_openrv_extended(rv, RowExclusiveLock, true);
23042306

23052307
if (rel == NULL) {
2306-
if (!IsTransactionBlock()) {
2308+
if (!MtmIsBroadcast()) {
23072309
MtmBroadcastUtilityStmt(queryString, false);
23082310
return true;
23092311
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy