Why does pingserver has two booleans for a single state?
This commit is contained in:
Ivan Skytte Jørgensen
2017-04-03 16:00:17 +02:00
parent 774b8755bb
commit 7d649c9d65
4 changed files with 4 additions and 3 deletions

@ -99,7 +99,7 @@ static void handleRequest4(UdpSlot *slot, int32_t /*netnice*/) {
}
// need to be in sync first
if ( ! g_pingServer.hostsConfInDisagreement() ) {
if ( ! g_pingServer.hostsConfInAgreement() ) {
// . if we do not know the sender's hosts.conf crc, wait 4 it
// . this is 0 if not received yet
if (!slot->m_host->m_pingInfo.m_hostsConfCRC) {

@ -44,6 +44,7 @@ class PingServer {
bool forceIt = false);
bool hostsConfInDisagreement() const { return m_hostsConfInDisagreement; }
bool hostsConfInAgreement() const { return m_hostsConfInAgreement; }
int getNumHostsDead() const { return m_numHostsDead; }
Host *getMinRepairModeHost() const { return m_minRepairModeHost; }

@ -57,7 +57,7 @@ const char *Rebalance::getNeedsRebalance ( ) {
if ( ! g_parms.inSyncWithHost0() ) return NULL;
// wait for all hosts to agree
if ( ! g_pingServer.hostsConfInDisagreement() ) return NULL;
if ( ! g_pingServer.hostsConfInAgreement() ) return NULL;
// for simplicty, only gb shards on stripe 0 should run this i guess
if ( g_hostdb.m_myHost->m_stripe != 0 ) {

@ -467,7 +467,7 @@ subloop:
// don't spider if not all hosts are up, or they do not all
// have the same hosts.conf.
if ( ! g_pingServer.hostsConfInDisagreement() ) {
if ( ! g_pingServer.hostsConfInAgreement() ) {
logTrace( g_conf.m_logTraceSpider, "END, host config disagreement" );
return;
}