From d94b9f177bb3e0463e9e8c4d75f4a51e417872ef Mon Sep 17 00:00:00 2001 From: Allison Easton Date: Wed, 7 Dec 2022 12:42:49 +0000 Subject: SERVER-71756 Defragmentation policy should issue dataSize commands with estimate true (cherry picked from commit 49c71b36991b5eb765f66e03d09af6673c9aead7) --- .../db/s/balancer/balancer_defragmentation_policy_impl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp b/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp index 63b2b8e4d22..df80d254e12 100644 --- a/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp +++ b/src/mongo/db/s/balancer/balancer_defragmentation_policy_impl.cpp @@ -217,8 +217,14 @@ public: if (pendingActions.rangesWithoutDataSize.size() > pendingActions.rangesToMerge.size()) { const auto& rangeToMeasure = pendingActions.rangesWithoutDataSize.back(); - nextAction = boost::optional(DataSizeInfo( - shardId, _nss, _uuid, rangeToMeasure, shardVersion, _shardKey, false)); + nextAction = + boost::optional(DataSizeInfo(shardId, + _nss, + _uuid, + rangeToMeasure, + shardVersion, + _shardKey, + true /* estimate */)); pendingActions.rangesWithoutDataSize.pop_back(); } else if (!pendingActions.rangesToMerge.empty()) { const auto& rangeToMerge = pendingActions.rangesToMerge.back(); -- cgit v1.2.1