[SERVER-49350] Modernize shell helper getBalancerState() Created: 07/Jul/20  Updated: 29/Oct/23  Resolved: 05/Oct/20

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

Type: Bug Priority: Major - P3
Reporter: Kelsey Schubert Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-34504 sh.getBalancerState does not consider... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2020-07-27, Sharding 2020-08-10, Sharding 2020-08-24, Sharding 2020-09-21, Sharding 2020-10-05, Sharding 2020-10-19
Participants:

 Description   

If a config server has the following setting document:

{ "_id" : "balancer", "_secondaryThrottle" : false, "mode" : "off" }

sh.getBalancerState() will return true because there is no "stopped" field, despite the mode field being set to "off."

This incorrect reporting can cause confusion. We should error when a field we expect to exist does not exist. If it's expected that the stopped field may not exist, then we shouldn't rely on it for checking the balancer state.

Please be mindful of internal callers of sh.getBalancerState() like sh.status() when implementing this change.



 Comments   
Comment by Githook User [ 02/Oct/20 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: SERVER-49350 Modernize shell helper getBalancerState()
Branch: master
https://github.com/mongodb/mongo/commit/718b02baa3af6cd96dd2078bb3a79402069a63c7

Comment by Blake Oler [ 02/Sep/20 ]

After talking with sharding members, we've decided that kAutopSplitOnly should be considered off.

Generated at Thu Feb 08 05:19:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.