summaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-06-11 08:42:54 +0000
committerArne Juul <arnej@verizonmedia.com>2021-06-11 08:42:54 +0000
commit6b0b774e1cccb73f036a00d3271c025a3be81192 (patch)
treebfc3cd43f45da1e378cc3c9fca1fdc17ee12a1ef /configd
parentad9ba1e3b43c7cf5e5ce94a38092d5a805c4e551 (diff)
change names of sentinel connectivity limits
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/connectivity.cpp22
-rw-r--r--configd/src/apps/sentinel/connectivity.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/configd/src/apps/sentinel/connectivity.cpp b/configd/src/apps/sentinel/connectivity.cpp
index 8d1aa0e9673..2cdd6f8a914 100644
--- a/configd/src/apps/sentinel/connectivity.cpp
+++ b/configd/src/apps/sentinel/connectivity.cpp
@@ -120,8 +120,8 @@ void classifyConnFails(ConnectivityMap &connectivityMap,
void Connectivity::configure(const SentinelConfig::Connectivity &config) {
_config = config;
- LOG(config, "connectivity.maxBadReverseCount = %d", _config.maxBadReverseCount);
- LOG(config, "connectivity.maxBadOutPercent = %d", _config.maxBadOutPercent);
+ LOG(config, "connectivity.maxBadCount = %d", _config.maxBadCount);
+ LOG(config, "connectivity.minOkPercent = %d", _config.minOkPercent);
if (auto up = ConfigOwner::fetchModelConfig(MODEL_TIMEOUT_MS)) {
_checkSpecs = specsFrom(*up);
}
@@ -165,31 +165,31 @@ void Connectivity::accumulate(Accumulated &target, CcResult value) {
case CcResult::UNREACHABLE_UP:
case CcResult::INDIRECT_PING_FAIL:
++target.numSeriousIssues;
- ++target.numIssues;
break;
case CcResult::CONN_FAIL:
- ++target.numIssues;
+ // not OK, but not a serious issue either
break;
case CcResult::INDIRECT_PING_UNAVAIL:
case CcResult::ALL_OK:
+ ++target.numUpAndOk;
break;
}
}
bool Connectivity::enoughOk(const Accumulated &results, size_t clusterSize) {
bool enough = true;
- if (results.numSeriousIssues > size_t(_config.maxBadReverseCount)) {
+ if (results.numSeriousIssues > size_t(_config.maxBadCount)) {
LOG(warning, "%zu of %zu nodes up but with network connectivity problems (max is %d)",
- results.numSeriousIssues, clusterSize, _config.maxBadReverseCount);
+ results.numSeriousIssues, clusterSize, _config.maxBadCount);
enough = false;
}
- if (results.numIssues * 100.0 > _config.maxBadOutPercent * clusterSize) {
- double pct = results.numIssues * 100.0 / clusterSize;
- LOG(warning, "Problems with connection to %zu of %zu nodes, %.1f%% (max is %d%%)",
- results.numIssues, clusterSize, pct, _config.maxBadOutPercent);
+ if (results.numUpAndOk * 100.0 < _config.minOkPercent * clusterSize) {
+ double pct = results.numUpAndOk * 100.0 / clusterSize;
+ LOG(warning, "Only %zu of %zu nodes are up and OK, %.1f%% (min is %d%%)",
+ results.numUpAndOk, clusterSize, pct, _config.minOkPercent);
enough = false;
}
- if (results.numIssues == 0) {
+ if (results.numUpAndOk == clusterSize) {
LOG(info, "All connectivity checks OK, proceeding with service startup");
} else if (enough) {
LOG(info, "Enough connectivity checks OK, proceeding with service startup");
diff --git a/configd/src/apps/sentinel/connectivity.h b/configd/src/apps/sentinel/connectivity.h
index a1e454a255a..6b0e2d7523e 100644
--- a/configd/src/apps/sentinel/connectivity.h
+++ b/configd/src/apps/sentinel/connectivity.h
@@ -28,7 +28,7 @@ public:
bool checkConnectivity(RpcServer &rpcServer);
private:
struct Accumulated {
- size_t numIssues = 0;
+ size_t numUpAndOk = 0;
size_t numSeriousIssues = 0;
};
void accumulate(Accumulated &target, CcResult value);