Geo: Reduce the synchronization delay between repositories on secondary node
The Geo::RepositorySyncWorker
runs every 5 minutes and schedule new/dirty repositories to be synced in 5 minutes (backoff delay). We can reach a window of 10 minutes or more, depending on the Sidekiq load and the number of events received/processed by a secondary node, where those repositories will not be in sync with the primary.
To reduce this window we can:
-
Schedule the repository sync when handling the project create/update events in the Geo Log Cursor, leaving the
Geo::RepositorySyncWorker
responsible only for the initial backfill. -
Improve our backoff strategy to reduce the delay (currently 5 minutes) between an event being processed by a secondary node and the synchronization itself.See https://gitlab.com/gitlab-org/gitlab-ee/issues/3230#note_41318427