Reduce wait time for replica if worker urgency is high
What does this MR do and why?
This reduces the sleep interval for workers with sticky/delayed data consistency while waiting for the replica to catch up. waiting.
See gitlab-com/gl-infra/scalability#3848.
This change only affects the following workers by using the primary without waiting/rescheduling if the replica is not up to date.
[16] pry(main)> Gitlab::SidekiqConfig.workers.filter{|c| c.klass.respond_to?(:get_data_consistency) && c.klass.get_data_consistency != :always }.filter{|c| c.klass.get_urgency == :high }.map(&:klass)
=> [BuildQueueWorker,
Issuable::RelatedLinksCreateWorker,
PipelineNotificationWorker,
PostReceive,
Projects::Forks::SyncWorker,
WorkItems::CopyTimelogsWorker,
ComplianceManagement::PendingStatusCheckWorker,
SecretsManagement::ProvisionProjectSecretsManagerWorker,
Security::CreateSecurityPolicyProjectWorker,
WorkItems::UpdateParentObjectivesProgressWorker]
See gitlab-com/gl-infra/scalability#3805 (comment 2139717129) for analysis on current sticky, urgent workers. Only ~0.3% of such workers experience at least 1 round of sleep.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.