Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit28ddd48

Browse files
committed
Return back error in MtmIsRecoveredNode() which was changed to warning in85c7597. Also introduce MtmDeepUnlock()
1 parent0b1ad5e commit28ddd48

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

‎contrib/mmts/multimaster.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,20 @@ void MtmUnlock(void)
394394
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
395395
}
396396

397+
voidMtmDeepUnlock(void)
398+
{
399+
if (MtmLockCount>0)
400+
Assert(Mtm->lastLockHolder==MyProcPid);
401+
402+
/* If we have no PGPROC, then lock was not obtained. */
403+
if (MyProc==NULL)
404+
return;
405+
406+
MtmLockCount=0;
407+
Mtm->lastLockHolder=0;
408+
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
409+
}
410+
397411
voidMtmLockNode(intnodeId,LWLockModemode)
398412
{
399413
Assert(nodeId>0&&nodeId <=MtmMaxNodes*2);
@@ -2133,7 +2147,8 @@ bool MtmIsRecoveredNode(int nodeId)
21332147
{
21342148
if (BIT_CHECK(Mtm->disabledNodeMask,nodeId-1)) {
21352149
if (!MtmIsRecoverySession) {
2136-
MTM_ELOG(WARNING,"Node %d is marked as disabled but is not in recovery mode",nodeId);
2150+
MtmDeepUnlock();
2151+
MTM_ELOG(ERROR,"Node %d is marked as disabled but is not in recovery mode",nodeId);
21372152
}
21382153
return true;
21392154
}else {

‎contrib/mmts/multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ extern void MtmSendMessage(MtmArbiterMessage* msg);
398398
externvoidMtmAdjustSubtransactions(MtmTransState*ts);
399399
externvoidMtmLock(LWLockModemode);
400400
externvoidMtmUnlock(void);
401+
externvoidMtmDeepUnlock(void);
401402
externvoidMtmLockNode(intnodeId,LWLockModemode);
402403
externboolMtmTryLockNode(intnodeId,LWLockModemode);
403404
externvoidMtmUnlockNode(intnodeId);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp