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)
395395 LWLockRelease ((LWLockId )& Mtm -> locks [MTM_STATE_LOCK_ID ]);
396396}
397397
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+
398412void MtmLockNode (int nodeId , LWLockMode mode )
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 {
Original file line number Diff line number Diff line change @@ -399,6 +399,7 @@ extern void MtmSendMessage(MtmArbiterMessage* msg);
399399extern void MtmAdjustSubtransactions (MtmTransState * ts );
400400extern void MtmLock (LWLockMode mode );
401401extern void MtmUnlock (void );
402+ extern void MtmDeepUnlock (void );
402403extern void MtmLockNode (int nodeId , LWLockMode mode );
403404extern bool MtmTryLockNode (int nodeId , LWLockMode mode );
404405extern void MtmUnlockNode (int nodeId );
You can’t perform that action at this time.
0 commit comments