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

Commit bae4679

Browse files
knizhnikkelvich
authored andcommitted
Reduce logging of multimaster
1 parent 242a42f commit bae4679

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

state.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ MtmSetClusterStatus(MtmNodeStatus status, char *statusReason)
106106
}
107107

108108
static void
109-
MtmCheckState(void)
109+
MtmCheckState(int severity)
110110
{
111111
// int nVotingNodes = MtmGetNumberOfVotingNodes();
112112
bool isEnabledState;
@@ -119,7 +119,7 @@ MtmCheckState(void)
119119

120120
old_status = Mtm->status;
121121

122-
MTM_LOG1("[STATE] Status = (disabled=%s, unaccessible=%s, clique=%s, receivers=%s, senders=%s, total=%i, major=%d, stopped=%s)",
122+
MTM_ELOG(severity, "[STATE] Status = (disabled=%s, unaccessible=%s, clique=%s, receivers=%s, senders=%s, total=%i, major=%d, stopped=%s)",
123123
maskToString(Mtm->disabledNodeMask, Mtm->nAllNodes),
124124
maskToString(SELF_CONNECTIVITY_MASK, Mtm->nAllNodes),
125125
maskToString(Mtm->clique, Mtm->nAllNodes),
@@ -166,7 +166,7 @@ MtmCheckState(void)
166166
MtmSetClusterStatus(MTM_RECOVERY, statusReason);
167167

168168
if (old_status != Mtm->status)
169-
MtmCheckState();
169+
MtmCheckState(LOG);
170170
return;
171171
}
172172
break;
@@ -179,7 +179,7 @@ MtmCheckState(void)
179179
MtmSetClusterStatus(MTM_RECOVERED, statusReason);
180180

181181
if (old_status != Mtm->status)
182-
MtmCheckState();
182+
MtmCheckState(LOG);
183183
return;
184184
}
185185
break;
@@ -204,7 +204,7 @@ MtmCheckState(void)
204204
MtmSetClusterStatus(MTM_ONLINE, statusReason);
205205

206206
if (old_status != Mtm->status)
207-
MtmCheckState();
207+
MtmCheckState(LOG);
208208
return;
209209
}
210210
break;
@@ -278,7 +278,7 @@ MtmStateProcessNeighborEvent(int node_id, MtmNeighborEvent ev) // XXXX camelcase
278278
break;
279279

280280
}
281-
MtmCheckState();
281+
MtmCheckState(LOG);
282282
MtmUnlock();
283283
}
284284

@@ -330,7 +330,7 @@ MtmStateProcessEvent(MtmEvent ev)
330330
break;
331331
}
332332

333-
MtmCheckState();
333+
MtmCheckState(LOG);
334334
MtmUnlock();
335335

336336
}
@@ -404,7 +404,7 @@ void MtmOnNodeDisconnect(int nodeId)
404404
MtmDisableNode(nodeId);
405405
Mtm->nConfigChanges += 1;
406406
BIT_SET(Mtm->reconnectMask, nodeId-1);
407-
MtmCheckState();
407+
MtmCheckState(LOG);
408408
MtmUnlock();
409409
}
410410

@@ -420,7 +420,7 @@ void MtmOnNodeConnect(int nodeId)
420420
BIT_CLEAR(SELF_CONNECTIVITY_MASK, nodeId-1);
421421
BIT_SET(Mtm->reconnectMask, nodeId-1);
422422

423-
MtmCheckState();
423+
MtmCheckState(LOG);
424424
MtmUnlock();
425425

426426
// MtmRefreshClusterStatus();
@@ -476,7 +476,7 @@ MtmRefreshClusterStatus()
476476
* See comment to MTM_RECOVERED -> MTM_ONLINE transition in MtmCheckState()
477477
*/
478478
MtmLock(LW_EXCLUSIVE);
479-
MtmCheckState();
479+
MtmCheckState(DEBUG1);
480480
MtmUnlock();
481481

482482
/*
@@ -516,7 +516,7 @@ MtmRefreshClusterStatus()
516516
MtmPollStatusOfPreparedTransactions(true);
517517
}
518518
MtmEnableNode(MtmNodeId);
519-
MtmCheckState();
519+
MtmCheckState(LOG);
520520
}
521521
MtmUnlock();
522522
}
@@ -610,7 +610,7 @@ MtmRefreshClusterStatus()
610610
}
611611
}
612612

613-
MtmCheckState();
613+
MtmCheckState(LOG);
614614
MtmUnlock();
615615
}
616616

0 commit comments

Comments
 (0)