Skip to content

Prevent Sidekiq sleep when DB replica is up-to-date

Heinrich Lee Yu requested to merge check-wal-before-sleep into master

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.

Edited by Heinrich Lee Yu

Merge request reports