Skip to content

Add schedule delay for RepositoryUpdateMirrorWorker

What does this MR do and why?

Problem

RepositoryUpdateMirrorWorker with sticky data consistency cannot find a replica in sync and falls back to primary.

Solution

Schedule RepositoryUpdateMirrorWorker with 1 minute delay. This delay should not be a problem because the delay between projects updates is higher and equal every 30 minutes.

Screenshots or screen recordings

Screenshot_2022-06-22_at_14.01.05

How to set up and validate locally

  1. Enable feature flag Feature.enable(:delay_for_repository_update_mirror)
  2. Create an empty project
  3. Go to Settings -> Repository -> Mirroring repositories
  4. Select Mirror direction - Pull, Git repository URL - https://gitlab.com/sinatra/sinatra.git (or any other public git project) and press Mirror repository
  5. Open Sidekiq monitoring - http://127.0.0.1:3000/admin/background_jobs (Scheduled tab)
  6. You should see RepositoryUpdateMirrorWorker job scheduled with 1 minute delay

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 Vasilii Iakliushin

Merge request reports

Loading