[SERVER-4963] Time zone ambiguity in balancer activeWindow Created: 14/Feb/12  Updated: 06/Dec/22  Resolved: 31/Oct/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.0.2, 2.1.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-9216 Handle mongos' with different timezon... Closed
Related
related to DOCS-5230 Advise setting server timezone to UTC... Closed
is related to SERVER-4587 Be consistent with time zones Backlog
is related to SERVER-18785 Store mongos timezone in config.mongo... Closed
Assigned Teams:
Sharding
Operating System: ALL
Participants:

 Description   

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.


Generated at Thu Feb 08 03:07:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.