Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
Tested with mongodb 2.6.1 on OS X
*Location*: http://docs.mongodb.org/manual/core/sharding-balancing/#sharding-migration-thresholds
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36
*Referrer*: http://docs.mongodb.org/manual/core/sharding-chunk-migration/
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: core/sharding-balancing
Tested with mongodb 2.6.1 on OS X *Location*: http://docs.mongodb.org/manual/core/sharding-balancing/#sharding-migration-thresholds *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36 *Referrer*: http://docs.mongodb.org/manual/core/sharding-chunk-migration/ *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: core/sharding-balancing
Description
From the migration thresholds list:
fewer than 20 = 2
21 - 80 = 4
What about 20 chunks exactly? It is not included in that list. For reference, I tested with 20 chunks exactly and the balancer reports the threshold as 4.
Test set up and loglevel 1 output:
sh.status()
|
--- Sharding Status ---
|
sharding version: {
|
"_id" : 1, |
"version" : 4, |
"minCompatibleVersion" : 4, |
"currentVersion" : 5, |
"clusterId" : ObjectId("538dabe1080df1beec495236") |
}
|
shards:
|
{ "_id" : "shard0000", "host" : "localhost:30000" } |
{ "_id" : "shard0001", "host" : "localhost:30001" } |
{ "_id" : "shard0002", "host" : "localhost:30002" } |
databases:
|
{ "_id" : "admin", "partitioned" : false, "primary" : "config" } |
{ "_id" : "balanceTest", "partitioned" : true, "primary" : "shard0001" } |
balanceTest.foo
|
shard key: { "_id" : 1 } |
chunks:
|
shard0001 5
|
shard0000 8
|
shard0002 7
|
too many chunks to print, use verbose if you want to force print |
|
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] shard0002 has more chunks me:7 best: shard0001:5
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] collection : balanceTest.foo
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] donor : shard0000 chunks on 8
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] receiver : shard0001 chunks on 5
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] threshold : 4
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] no need to move any chunk
|
m30999| 2014-06-03T12:29:44.771+0100 [Balancer] *** end of balancing round
|