From d8b4ac75423456efd6401264e6d9c6b95d9b21e6 Mon Sep 17 00:00:00 2001 From: Randolph Tan Date: Fri, 30 Sep 2016 10:58:05 -0400 Subject: SERVER-26285 Make sure that the balancer settings gets refreshed periodically --- src/mongo/s/sharding_uptime_reporter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mongo/s/sharding_uptime_reporter.cpp') diff --git a/src/mongo/s/sharding_uptime_reporter.cpp b/src/mongo/s/sharding_uptime_reporter.cpp index 8a4b8d756d1..bdd7f0c26d3 100644 --- a/src/mongo/s/sharding_uptime_reporter.cpp +++ b/src/mongo/s/sharding_uptime_reporter.cpp @@ -34,6 +34,7 @@ #include "mongo/db/client.h" #include "mongo/db/server_options.h" +#include "mongo/s/balancer/balancer_configuration.h" #include "mongo/s/catalog/sharding_catalog_client.h" #include "mongo/s/catalog/type_mongos.h" #include "mongo/s/grid.h" @@ -71,6 +72,12 @@ void ShardingUptimeReporter::startPeriodicThread() { { auto txn = cc().makeOperationContext(); reportStatus(txn.get(), false); + + auto status = + Grid::get(txn.get())->getBalancerConfiguration()->refreshAndCheck(txn.get()); + if (!status.isOK()) { + warning() << "failed to refresh mongos settings" << causedBy(status); + } } sleepFor(kUptimeReportInterval); -- cgit v1.2.1