Skip to content

Commit 945dc59

Browse files
committed
Fix several places where error was thrown under exclusive mtm lock
1 parent b28da7f commit 945dc59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/mmts/multimaster.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,7 @@ MtmEndTransaction(MtmCurrentTrans* x, bool commit)
15001500
if (!(ts->status == TRANSACTION_STATUS_UNKNOWN
15011501
|| (ts->status == TRANSACTION_STATUS_IN_PROGRESS && Mtm->status == MTM_RECOVERY)))
15021502
{
1503+
MtmUnlock();
15031504
MTM_ELOG(ERROR, "Attempt to commit %s transaction %s (%llu)",
15041505
MtmTxnStatusMnem[ts->status], ts->gid, (long64)ts->xid);
15051506
}
@@ -2128,7 +2129,7 @@ bool MtmIsRecoveredNode(int nodeId)
21282129
{
21292130
if (BIT_CHECK(Mtm->disabledNodeMask, nodeId-1)) {
21302131
if (!MtmIsRecoverySession) {
2131-
MTM_ELOG(ERROR, "Node %d is marked as disabled but is not in recovery mode", nodeId);
2132+
MTM_ELOG(WARNING, "Node %d is marked as disabled but is not in recovery mode", nodeId);
21322133
}
21332134
return true;
21342135
} else {
@@ -2222,6 +2223,7 @@ MtmLockCluster(void)
22222223
}
22232224
MtmLock(LW_EXCLUSIVE);
22242225
if (BIT_CHECK(Mtm->originLockNodeMask, MtmNodeId-1)) {
2226+
MtmUnlock();
22252227
elog(ERROR, "There is already pending exclusive lock");
22262228
}
22272229
BIT_SET(Mtm->originLockNodeMask, MtmNodeId-1);

0 commit comments

Comments
 (0)