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

Commit1fdf868

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

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

‎multimaster.c‎

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

398+
voidMtmDeepUnlock(void)
399+
{
400+
if (MtmLockCount>0)
401+
Assert(Mtm->lastLockHolder==MyProcPid);
402+
403+
/* If we have no PGPROC, then lock was not obtained. */
404+
if (MyProc==NULL)
405+
return;
406+
407+
MtmLockCount=0;
408+
Mtm->lastLockHolder=0;
409+
LWLockRelease((LWLockId)&Mtm->locks[MTM_STATE_LOCK_ID]);
410+
}
411+
398412
voidMtmLockNode(intnodeId,LWLockModemode)
399413
{
400414
Assert(nodeId>0&&nodeId <=MtmMaxNodes*2);
@@ -2033,7 +2047,8 @@ bool MtmIsRecoveredNode(int nodeId)
20332047
{
20342048
if (BIT_CHECK(Mtm->disabledNodeMask,nodeId-1)) {
20352049
if (!MtmIsRecoverySession) {
2036-
MTM_ELOG(WARNING,"Node %d is marked as disabled but is not in recovery mode",nodeId);
2050+
MtmDeepUnlock();
2051+
MTM_ELOG(ERROR,"Node %d is marked as disabled but is not in recovery mode",nodeId);
20372052
}
20382053
return true;
20392054
}else {

‎multimaster.h‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp