Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit da7d6d5

Browse files
Alexander Kuzmenkovkelvich
Alexander Kuzmenkov
authored andcommitted
Show the reason for the node status.
1 parent bdbaeff commit da7d6d5

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

state.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ MtmCheckState(void)
129129
(MtmMajorNode || Mtm->refereeGrant),
130130
maskToString(Mtm->stoppedNodeMask, Mtm->nAllNodes));
131131

132-
#define ENABLE_IF(cond, reason) if (!(condition) && !isEnabledState) { \
132+
#define ENABLE_IF(cond, reason) if (!(cond) && !isEnabledState) { \
133133
isEnabledState = true; statusReason = reason; }
134-
#define DISABLE_IF(cond, reason) if ((condition) && isEnabledState) { \
134+
#define DISABLE_IF(cond, reason) if ((cond) && isEnabledState) { \
135135
isEnabledState = false; statusReason = reason; }
136136

137137
isEnabledState = false;
@@ -161,11 +161,15 @@ MtmCheckState(void)
161161
switch (Mtm->status)
162162
{
163163
case MTM_DISABLED:
164-
MtmSetClusterStatus(MTM_RECOVERY, statusReason);
164+
if (isEnabledState)
165+
{
166+
MtmSetClusterStatus(MTM_RECOVERY, statusReason);
165167

166-
if (old_status != Mtm->status)
167-
MtmCheckState();
168-
return;
168+
if (old_status != Mtm->status)
169+
MtmCheckState();
170+
return;
171+
}
172+
break;
169173

170174
case MTM_RECOVERY:
171175
if (!BIT_CHECK(Mtm->disabledNodeMask, MtmNodeId-1))

0 commit comments

Comments
 (0)