diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-10-25 12:57:01 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-10-26 16:24:10 -0400 |
commit | cc75cf210c63a0c96c74e01f3919938ea64a0317 (patch) | |
tree | 179813e9ceb2a2c20e33d20022dac233b57e7ec1 /src/mongo/db/s/balancer/balancer_policy.h | |
parent | 266b947f6e9e021b85746b3b80b723b7d3b2c2f2 (diff) | |
download | mongo-cc75cf210c63a0c96c74e01f3919938ea64a0317.tar.gz |
SERVER-26770 Do not move chunks out of shards with below-average utilization
Diffstat (limited to 'src/mongo/db/s/balancer/balancer_policy.h')
-rw-r--r-- | src/mongo/db/s/balancer/balancer_policy.h | 7 |
1 files changed, 6 insertions, 1 deletions
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<MigrateInfo>* migrations, std::set<ShardId>* usedShards); |