Prevent Sidekiq sleep when DB replica is up-to-date
What does this MR do and why?
This is a follow-up to !74532 (merged)
Based on previous tests, even without any delay, 50% of jobs get picked up when the replica is already up-to-date. This change skips the sleep
for those cases.
In the worst case, this adds an extra WAL check query, but these are very fast queries.
Related to gitlab-com/gl-infra/scalability#1380 (comment 756167450)
This is behind the skip_scheduling_workers_for_replicas
feature flag.
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.
Edited by Heinrich Lee Yu