Adjusts GitlabSubscription#requiring_seat_refresh scope
What does this MR do and why?
During rollout of the feature flag controller the limited capacity worker, GitlabSubscriptions::RefreshSeatsWorker
, I noticed that our usage of timestamps was exhibiting peculiar behaviour after the initial refresh was carried out.
Background
We schedule the limited capacity jobs every 6 hours, i.e. 00:00:00, 06:00:00, 12:00:00 and 18:00:00.
When the limited capacity job begins performing, it:
- finds
GitlabSubscription
records that have not been updated in 24 hours or more by inspecting thelast_seat_refresh_at
column - updates the
last_seat_refresh_at
to be the current time - moves onto the next subscription, if there are any
This has the possibility to miss subscriptions depending on execution time, until the next scheduled time, i.e. 6 hours later. There's a more detailed explanation here: #382725 (comment 1286486024)
This MR attempts to resolve the problem by adjusting the scope look back to be 18 hours from 24 hours, to ensure we're catching those edge cases. More detail here: #382725 (comment 1292471927)
This work is behind a disabled feature flag.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.