[SERVER-25965] Sharding balancer always bounces a single extra chunk if there are less than 20 chunks in total Created: 06/Sep/16  Updated: 19/Nov/16  Resolved: 06/Sep/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.3.12
Fix Version/s: 3.3.14

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2016-09-19
Participants:
Linked BF Score: 0

 Description   

The logic in the sharding balancer policy uses an integer division in order to determine the optimal number of chunks per shard in a cluster. Because of this, the result gets rounded down, which makes the optimal number of chunks in a cluster with 3 chunks and 2 shards to be 1. Because of this, the balancer will move a chunk on each iteration and the cluster will never be deemed "balanced".



 Comments   
Comment by Githook User [ 06/Sep/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-25965 Use 'ceil' division when determining the optimal number of chunks per shard
Branch: master
https://github.com/mongodb/mongo/commit/175408e60358fe0407a4c24e8057a73f0031a9a3

Generated at Thu Feb 08 04:10:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.