@@ -108,18 +108,15 @@ MtmSetClusterStatus(MtmNodeStatus status, char *statusReason)
108
108
static void
109
109
MtmCheckState (void )
110
110
{
111
- // int nVotingNodes = MtmGetNumberOfVotingNodes();
112
111
bool isEnabledState ;
113
112
char * statusReason = "node is disabled by default" ;
114
113
MtmNodeStatus old_status ;
115
- int nEnabled = countZeroBits (Mtm -> disabledNodeMask , Mtm -> nAllNodes );
116
- int nConnected = countZeroBits (SELF_CONNECTIVITY_MASK , Mtm -> nAllNodes );
117
- int nReceivers = Mtm -> nAllNodes - countZeroBits (Mtm -> pglogicalReceiverMask , Mtm -> nAllNodes );
118
- int nSenders = Mtm -> nAllNodes - countZeroBits (Mtm -> pglogicalSenderMask , Mtm -> nAllNodes );
114
+ int nConnected = countZeroBits (EFFECTIVE_CONNECTIVITY_MASK , Mtm -> nAllNodes );
119
115
120
116
old_status = Mtm -> status ;
121
117
122
- MTM_LOG1 ("[STATE] Status = (disabled=%s, unaccessible=%s, clique=%s, receivers=%s, senders=%s, total=%i, major=%d, stopped=%s)" ,
118
+ MTM_LOG1 ("[STATE] %s: (disabled=%s, unaccessible=%s, clique=%s, receivers=%s, senders=%s, total=%i, major=%d, stopped=%s)" ,
119
+ MtmNodeStatusMnem [Mtm -> status ],
123
120
maskToString (Mtm -> disabledNodeMask , Mtm -> nAllNodes ),
124
121
maskToString (SELF_CONNECTIVITY_MASK , Mtm -> nAllNodes ),
125
122
maskToString (Mtm -> clique , Mtm -> nAllNodes ),
@@ -192,20 +189,26 @@ MtmCheckState(void)
192
189
* in MTM_RECOVERED state.
193
190
*/
194
191
case MTM_RECOVERED :
195
- if (nReceivers == nEnabled - 1 && nSenders == nEnabled - 1 && nEnabled == nConnected )
196
192
{
197
- /*
198
- * It should be already cleaned by RECOVERY_CAUGHTUP, but
199
- * in major mode or with referee we can be working alone
200
- * so nobody will clean it.
201
- */
202
- MTM_LOG1 ("[LOCK] release lock on MTM_RECOVERED switch" );
203
- BIT_CLEAR (Mtm -> originLockNodeMask , MtmNodeId - 1 );
204
- MtmSetClusterStatus (MTM_ONLINE , statusReason );
193
+ int nEnabled = countZeroBits (Mtm -> disabledNodeMask , Mtm -> nAllNodes );
194
+ int nReceivers = Mtm -> nAllNodes - countZeroBits (Mtm -> pglogicalReceiverMask , Mtm -> nAllNodes );
195
+ int nSenders = Mtm -> nAllNodes - countZeroBits (Mtm -> pglogicalSenderMask , Mtm -> nAllNodes );
205
196
206
- if (old_status != Mtm -> status )
207
- MtmCheckState ();
208
- return ;
197
+ if (nReceivers == nEnabled - 1 && nSenders == nEnabled - 1 && nEnabled == nConnected )
198
+ {
199
+ /*
200
+ * It should be already cleaned by RECOVERY_CAUGHTUP, but
201
+ * in major mode or with referee we can be working alone
202
+ * so nobody will clean it.
203
+ */
204
+ MTM_LOG1 ("[LOCK] release lock on MTM_RECOVERED switch" );
205
+ BIT_CLEAR (Mtm -> originLockNodeMask , MtmNodeId - 1 );
206
+ MtmSetClusterStatus (MTM_ONLINE , statusReason );
207
+
208
+ if (old_status != Mtm -> status )
209
+ MtmCheckState ();
210
+ return ;
211
+ }
209
212
}
210
213
break ;
211
214
0 commit comments