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

Time zone ambiguity in balancer activeWindow

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0.2, 2.1.0
    • Component/s: Sharding
    • None
    • Sharding
    • ALL

      If a config server has activeWindow set as in the documentation: { activeWindow :

      { start : "9:00", stop : "21:00" }

      }

      ... it is ambiguous what time zone those hours are in. Mongos compares its local time to the active window:

      https://github.com/mongodb/mongo/blob/master/src/mongo/s/grid.cpp#L447

      If mongos is running on a machine with a different time zone than whatever zone the administrator was thinking of when s/he configured the activeWindow, then mongos will balance outside the intended window. If different mongoses are in different zones, they will use different balancing windows.

      Suggested fixes: backward-breaking change to specify that activeWindow is time of day UTC, use universal_time() in mongos.

      Or, activeWindow is specified as being in the config server's time zone, and the config server implements a new command, shouldBalance, and mongoses run the command on the config server to see if they should balance now.

      Or, activeWindow is specified as being in the config server's time zone, and config servers report their offset from UTC so mongoses can convert the window to UTC before checking if they should balance.

      Or, activeWindow contains an offset which is reported to mongos.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: