File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -395,6 +395,20 @@ void MtmUnlock(void)
395
395
LWLockRelease ((LWLockId )& Mtm -> locks [MTM_STATE_LOCK_ID ]);
396
396
}
397
397
398
+ void MtmDeepUnlock (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
+
398
412
void MtmLockNode (int nodeId , LWLockMode mode )
399
413
{
400
414
Assert (nodeId > 0 && nodeId <= MtmMaxNodes * 2 );
@@ -2033,7 +2047,8 @@ bool MtmIsRecoveredNode(int nodeId)
2033
2047
{
2034
2048
if (BIT_CHECK (Mtm -> disabledNodeMask , nodeId - 1 )) {
2035
2049
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 );
2037
2052
}
2038
2053
return true;
2039
2054
} else {
Original file line number Diff line number Diff line change @@ -399,6 +399,7 @@ extern void MtmSendMessage(MtmArbiterMessage* msg);
399
399
extern void MtmAdjustSubtransactions (MtmTransState * ts );
400
400
extern void MtmLock (LWLockMode mode );
401
401
extern void MtmUnlock (void );
402
+ extern void MtmDeepUnlock (void );
402
403
extern void MtmLockNode (int nodeId , LWLockMode mode );
403
404
extern bool MtmTryLockNode (int nodeId , LWLockMode mode );
404
405
extern void MtmUnlockNode (int nodeId );
You can’t perform that action at this time.
0 commit comments