File tree 2 files changed +17
-1
lines changed 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -394,6 +394,20 @@ void MtmUnlock(void)
394
394
LWLockRelease ((LWLockId )& Mtm -> locks [MTM_STATE_LOCK_ID ]);
395
395
}
396
396
397
+ void MtmDeepUnlock (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
+
397
411
void MtmLockNode (int nodeId , LWLockMode mode )
398
412
{
399
413
Assert (nodeId > 0 && nodeId <= MtmMaxNodes * 2 );
@@ -2133,7 +2147,8 @@ bool MtmIsRecoveredNode(int nodeId)
2133
2147
{
2134
2148
if (BIT_CHECK (Mtm -> disabledNodeMask , nodeId - 1 )) {
2135
2149
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 );
2137
2152
}
2138
2153
return true;
2139
2154
} else {
Original file line number Diff line number Diff line change @@ -398,6 +398,7 @@ extern void MtmSendMessage(MtmArbiterMessage* msg);
398
398
extern void MtmAdjustSubtransactions (MtmTransState * ts );
399
399
extern void MtmLock (LWLockMode mode );
400
400
extern void MtmUnlock (void );
401
+ extern void MtmDeepUnlock (void );
401
402
extern void MtmLockNode (int nodeId , LWLockMode mode );
402
403
extern bool MtmTryLockNode (int nodeId , LWLockMode mode );
403
404
extern void MtmUnlockNode (int nodeId );
You can’t perform that action at this time.
0 commit comments