From cc75cf210c63a0c96c74e01f3919938ea64a0317 Mon Sep 17 00:00:00 2001 From: Kaloian Manassiev Date: Tue, 25 Oct 2016 12:57:01 -0400 Subject: SERVER-26770 Do not move chunks out of shards with below-average utilization --- src/mongo/db/s/balancer/balancer_policy.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/s/balancer/balancer_policy.h') diff --git a/src/mongo/db/s/balancer/balancer_policy.h b/src/mongo/db/s/balancer/balancer_policy.h index c08aee77ceb..63f44c3ca68 100644 --- a/src/mongo/db/s/balancer/balancer_policy.h +++ b/src/mongo/db/s/balancer/balancer_policy.h @@ -214,7 +214,11 @@ private: /** * Selects one chunk for the specified zone (if appropriate) to be moved in order to bring the * deviation of the shards chunk contents closer to even across all shards in the specified - * zone. Takes into account the shards, which have already been used for migrations. + * zone. Takes into account and updates the shards, which have already been used for migrations. + * + * The 'idealNumberOfChunksPerShardForTag' indicates what is the ideal number of chunks which + * each shard must have and is used to determine the imbalance and also to prevent chunks from + * moving when not necessary. * * Returns true if a migration was suggested, false otherwise. This method is intented to be * called multiple times until all posible migrations for a zone have been selected. @@ -222,6 +226,7 @@ private: static bool _singleZoneBalance(const ShardStatisticsVector& shardStats, const DistributionStatus& distribution, const std::string& tag, + size_t idealNumberOfChunksPerShardForTag, size_t imbalanceThreshold, std::vector* migrations, std::set* usedShards); -- cgit v1.2.1