@@ -60,14 +60,6 @@ MtmSetClusterStatus(MtmNodeStatus status)
6060 MTM_LOG1 ("[STATE] Switching status from %s to %s status" ,
6161 MtmNodeStatusMnem [Mtm -> status ], MtmNodeStatusMnem [status ]);
6262
63- /* Do some actions on specific status transitions */
64- if (status == MTM_IN_MINORITY )
65- {
66- Mtm -> recoverySlot = 0 ;
67- Mtm -> pglogicalReceiverMask = 0 ;
68- Mtm -> pglogicalSenderMask = 0 ;
69- }
70-
7163 Mtm -> status = status ;
7264}
7365
@@ -88,27 +80,21 @@ MtmCheckState(void)
8880 maskToString (Mtm -> pglogicalSenderMask , Mtm -> nAllNodes ),
8981 Mtm -> nAllNodes );
9082
91- /* ANY -> MTM_IN_MINORITY */
92- if (nConnected < Mtm -> nAllNodes /2 + 1 )
83+ /* ANY -> MTM_DISABLED */
84+ if ( nConnected < Mtm -> nAllNodes /2 + 1 ||
85+ !BIT_CHECK (Mtm -> clique , MtmNodeId - 1 ) )
9386 {
9487 BIT_SET (Mtm -> disabledNodeMask , MtmNodeId - 1 );
95- MtmSetClusterStatus (MTM_IN_MINORITY );
96- return ;
97- }
98-
99- /* ANY -> CLIQUE_DISABLE */
100- if (!BIT_CHECK (Mtm -> clique , MtmNodeId - 1 ))
101- {
102- /* Should be already disabled by clique detector */
103- // Assert(BIT_CHECK(Mtm->disabledNodeMask, MtmNodeId-1));
104- MtmSetClusterStatus (MTM_OUT_OF_CLIQUE );
88+ Mtm -> recoverySlot = 0 ;
89+ Mtm -> pglogicalReceiverMask = 0 ;
90+ Mtm -> pglogicalSenderMask = 0 ;
91+ MtmSetClusterStatus (MTM_DISABLED );
10592 return ;
10693 }
10794
10895 switch (Mtm -> status )
10996 {
110- case MTM_IN_MINORITY :
111- case MTM_OUT_OF_CLIQUE :
97+ case MTM_DISABLED :
11298 if ( (nConnected >= Mtm -> nAllNodes /2 + 1 ) && /* majority */
11399 BIT_CHECK (Mtm -> clique , MtmNodeId - 1 ) ) /* in clique */
114100 {
@@ -173,7 +159,7 @@ MtmStateProcessNeighborEvent(int node_id, MtmNeighborEvent ev)
173159
174160 case MTM_NEIGHBOR_WAL_SENDER_START_RECOVERED :
175161 BIT_SET (Mtm -> pglogicalSenderMask , node_id - 1 );
176- MtmEnableNode (node_id );
162+ MtmEnableNode (node_id ); /// XXXX ?
177163 break ;
178164
179165 case MTM_NEIGHBOR_RECOVERY_CAUGHTUP :
@@ -293,14 +279,12 @@ void MtmOnNodeDisconnect(int nodeId)
293279 if (BIT_CHECK (SELF_CONNECTIVITY_MASK , nodeId - 1 ))
294280 return ;
295281
296- MtmDisableNode (nodeId );
297-
298282 MTM_LOG1 ("[STATE] Node %i: disconnected" , nodeId );
299283
300284 MtmLock (LW_EXCLUSIVE );
301285 BIT_SET (SELF_CONNECTIVITY_MASK , nodeId - 1 );
302286 BIT_SET (Mtm -> reconnectMask , nodeId - 1 );
303-
287+ // MtmDisableNode(nodeId);
304288 MtmCheckState ();
305289 MtmUnlock ();
306290
0 commit comments