[DOCS-3529] Comment on: "manual/core/sharding-balancing.txt" Created: 03/Jun/14  Updated: 04/Jun/14  Resolved: 04/Jun/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.6

Type: Improvement Priority: Major - P3
Reporter: Adam Comerford Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

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


Participants:
Days since reply: 9 years, 37 weeks ago

 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



 Comments   
Comment by Githook User [ 04/Jun/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-3529 update migration threshold
Branch: v2.2
https://github.com/mongodb/docs/commit/2fe0301e214fc7f905cbf29705d2191a0f0cd701

Comment by Githook User [ 04/Jun/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-3529 update migration threshold
Branch: v2.4
https://github.com/mongodb/docs/commit/68c2143fb805dc685c63dddb1bb020f1cefa0cac

Comment by Kay Kim (Inactive) [ 04/Jun/14 ]

Hey adamc

I took a peek at balancer_policy.cpp and found the following:

        int threshold = 8;
        if ( balancedLastTime || distribution.totalChunks() < 20 )
            threshold = 2;
        else if ( distribution.totalChunks() < 80 )
            threshold = 4;

So, updated

  • 21-80 --> 20-79
  • Greater than 80 --> 80 and greater.
Comment by Githook User [ 04/Jun/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-3529 update migration threshold
Branch: master
https://github.com/mongodb/docs/commit/44d06d4cbae1871ad241bfcdfebf67f608d9b8b4

Generated at Thu Feb 08 07:45:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.