summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/balancer/balancer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/balancer/balancer.cpp')
-rw-r--r--src/mongo/db/s/balancer/balancer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/s/balancer/balancer.cpp b/src/mongo/db/s/balancer/balancer.cpp
index 52bacd4d743..7d9b40d5ac5 100644
--- a/src/mongo/db/s/balancer/balancer.cpp
+++ b/src/mongo/db/s/balancer/balancer.cpp
@@ -389,6 +389,8 @@ void Balancer::report(OperationContext* opCtx, BSONObjBuilder* builder) {
}
void Balancer::_consumeActionStreamLoop() {
+ ScopeGuard onExitCleanup([this] { _defragmentationPolicy->interruptAllDefragmentations(); });
+
Client::initThread("BalancerSecondary");
auto applyThrottling = [lastActionTime = Date_t::fromMillisSinceEpoch(0)]() mutable {
const Milliseconds throttle{chunkDefragmentationThrottlingMS.load()};