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

sh.startBalancer() should retry to change the settings while waiting

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.2.4, 2.4.3
    • Sharding
    • None
    • Sharding

    Description

      Currently, running sh.startBalancer() seems to only call sh.setBalancerState(true) once at the beginning, then waits for the balancer lock to change (by default 30 sec).

      This is problematic for scripted backup procedures along these steps

      1. stop balancer
      2. stop a config server
      3. back up ...
      4. start the config server
      5. start balancer

      If there are no hard-coded timeouts between 4. and 5. the config server may miss the call to sh.setBalancerState(true) (or reject it, if not all 3 are running yet) and then wait in the loop until timed out.

      Instead, it would be better if sh.startBalancer() kept pushing the settings while in the wait loop. If the config server comes up in the mean time, it would receive the next state change and the balancer would start.

      Attachments

        Activity

          People

            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: