Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49350

Modernize shell helper getBalancerState()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Sharding 2020-07-27, Sharding 2020-08-10, Sharding 2020-08-24, Sharding 2020-09-21, Sharding 2020-10-05, Sharding 2020-10-19

      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.

            Assignee:
            blake.oler@mongodb.com Blake Oler
            Reporter:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: