Skip to content

Geo: Handle repository and wiki sync separately in Geo::ProjectSyncWorker

What does this MR do?

See https://gitlab.com/gitlab-org/gitlab-ee/issues/9446. This is alternative implementation of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9338

The intention is to remove repository_sync_due? and wiki_sync_due? call from ProjectSyncWorker and add extra options to selectively sync repositories or/and wikis. This effectively takes a decision on what to sync out of Geo::ProjectSyncWorker class, making its function more straightforward.

This implementation adds one extra query Geo::ProjectRegistry.find_or_initialize_by(project_id: project_id) per project sync (from a cron job) but it will/should be cached by PG and is not expensive at all. In return, we get a number of benefits. We can selectively sync repo or/and wiki and we can easily implement https://gitlab.com/gitlab-org/gitlab-ee/issues/5348

What are the relevant issue numbers?

closes https://gitlab.com/gitlab-org/gitlab-ee/issues/9446 and https://gitlab.com/gitlab-org/gitlab-ee/issues/9444

Does this MR meet the acceptance criteria?

Closes #9446 (closed)

Edited by Valery Sizov

Merge request reports