[SERVER-29549] balancer ignoring maxSize setting? Created: 10/Jun/17  Updated: 27/Oct/23  Resolved: 27/Jun/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.12
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Crimson Glory Assignee: Randolph Tan
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

Initial setup.
Two shards: shard1 and shard2
shard1 with maxSize A, already full.
shard2 without maxSize.

1. change maxSize of shard1 to A/2
2. use moveChunks to move chunks from shard1 to shard2 until in getShardDistribution() you get A/2 of usage.
3. compact shard1 to free disk space.

After that the load balancer will start moving from shard2 to shard1 until 'A' size is reached, even if maxSize was changed to A/2.

Participants:

 Description   

maxSize setting is ignored by the balancer.
I think, (but I'm not sure), that after than update in the maxSize setting, one has to restart the loadbalancer so that it reads the new maxSize setting.
If this is true, then is not reflected in the documentation.

When does the balancer get notified of a maxSize change?



 Comments   
Comment by Crimson Glory [ 27/Jun/17 ]

Thanks. You can close this ticket.
It would be nice if this was reflected on the documentation. I created a pull request:
https://github.com/mongodb/docs/pull/2907

Comment by Randolph Tan [ 13/Jun/17 ]

Hi,

The balancer retrieves the maxSize setting at the beginning of a balancer round. If you modified the setting when a balancing round already started, it won't get reflected until the next balancing round. If you wish to synchronize a setting change and the balancer, you can stop the balancer first (wait for it to finish the current round - the sh.stopBalancer shell helper already does this for you). Also note that the maxSize setting does not prevent documents from being inserted to a shard, it only prevents balancer from moving chunks to this shard if the maxSize is reached.

Let me know if you're still experiencing the issue after you followed the stopBalancer suggestion I just mentioned.

Hope that helps!

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