A user should be able to specify a balancing window for each day of the week
db.settings.updateOne(
{ _id: "balancer" },
{ $set: { activeWindowDOW : { day : "<day_name>", start : "<start-time>", stop : "<stop-time>" } } },
{ upsert: true }
)
Let's introduce a new field "activeWindowDOW" to not break backward compatibility or upgrades.
For example, to set the balancing window from 9 to 5 Monday through Friday, and all day on weekends you would do the following:
db.settings.updateOne(
{ _id: "balancer" },
{ $set: {activeWindowDOW: [
{ day: "Monday", start: "00:01", stop: "23:59" },
{ day: "Tuesday", start: "09:00", stop: "17:00" },
{ day: "Wednesday", start: "09:00", stop: "17:00" },
{ day: "Thursday", start: "09:00", stop: "17:00" },
{ day: "Friday", start: "09:00", stop: "17:00" },
{ day: "Saturday", start: "09:00", stop: "17:00" },
{ day: "Sunday", start: "00:01", stop: "23:59" }
]
}
},
{ upsert: true }
)
If they want to run overnight on weekdays from 10 PM to 6 AM, and all day on weekends, they will have to set multiple windows per day:
db.settings.updateOne(
{ _id: "balancer" },
{ $set: {activeWindowDOW: [
{day: "Monday", start: "22:00", stop: "23:59" },
{day: "Tuesday", start: "00:00", stop: "06:00" },
{day: "Tuesday", start: "22:00", stop: "23:59" },
{day: "Wednesday", start: "00:00", stop: "06:00" },
{day: "Wednesday", start: "22:00", stop: "23:59" },
{day: "Thursday", start: "00:00", stop: "06:00" },
{day: "Thursday", start: "22:00", stop: "23:59" },
{day: "Friday", start: "00:00", stop: "06:00" },
{day: "Friday", start: "22:00", stop: "23:59" },
{ day: "Saturday", start: "00:01", stop: "23:59" },
{ day: "Sunday", start: "00:01", stop: "23:59" }
]
}
},
{ upsert: true }
)
They can also do the same thing by setting multiple balancing windows per day:
db.settings.updateOne(
{ _id: "balancer" },
{ $set: {activeWindowDOW: [
{ day: "Sunday", start: "00:01", stop: "23:59" },
{ day: "Monday", start: "09:00", stop: "17:00" },
{ day: "Monday", start: "22:00", stop: "23:59" },
{ day: "Wednesday", start: "09:00", stop: "17:00" },
{ day: "Wednesday", start: "22:00", stop: "23:59" },
{ day: "Friday", start: "09:00", stop: "17:00" },
{ day: "Saturday", start: "00:01", stop: "23:59" }
]
}
},
{ upsert: true }
)
If the user does the existing way below, it will also continue to work and apply to every day of the week.
db.settings.updateOne(
{ _id: "balancer" },
{ $set: { activeWindow : { start : "<start-time>", stop : "<stop-time>" } } },
{ upsert: true }
)
- depends on
-
SERVER-107403 Create balancer window DOW feature flag
-
- Closed
-
- is depended on by
-
SERVER-107399 Create admin command to update balancer configuration
-
- Backlog
-
-
SERVER-107400 Update balancerStatus to return the active balance window configuration
-
- Backlog
-
-
SERVER-108061 Integrate balancer config IDL
-
- In Code Review
-
-
SERVER-107486 Create IDL for balancer configuration options
-
- Closed
-
- is duplicated by
-
SERVER-82486 Balancing Window Per Day of the week
-
- Closed
-