Details
-
Improvement
-
Resolution: Done
-
Minor - P4
-
None
-
*Location*: http://docs.mongodb.org/manual/core/tag-aware-sharding/
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: core/tag-aware-sharding
Description
The note
"Note If the chunks in sharded collection are already balanced, then the balancer will not migrate any chunks. If chunks in a sharded collection are not balanced, the balancer migrates chunks in tagged ranges to shards associated with those tags."
is incorrect. During a balancing round, determining if any tag violations exist takes precedence over whether chunks are evenly distributed or not.
From "balancer_policy.cpp"
MigrateInfo* BalancerPolicy::balance( const string& ns,
|
const DistributionStatus& distribution,
|
int balancedLastTime ) {
|
|
|
|
|
// 1) check for shards that policy require to us to move off of:
|
// draining only
|
// 2) check tag policy violations
|
// 3) then we make sure chunks are balanced for each tag
|