Geo - Re-run a full resync for imports on GPRD
Summary
Project imports may not be synced if a repository takes some time to fetch. To avoid a potential data-loss, we should mark all repositories as unsynced on secondary.
Steps
-
Get a list of imported project ids:
project_ids = Project.where.not(import_type: nil).pluck(:id)
-
Mark the repositories as unsynced on the secondary node:
project_ids.in_groups(1000, false) { |ids| Geo::ProjectRegistry.where(project_id: ids).update_all(resync_repository: true, repository_verification_checksum_sha: nil, repository_checksum_mismatch: false, last_repository_verification_failure: nil, resync_repository_was_scheduled_at: Time.now, resync_wiki: true, wiki_verification_checksum_sha: nil, wiki_checksum_mismatch: false, last_wiki_verification_failure: nil, resync_wiki_was_scheduled_at: Time.now); sleep(2) }
Monitoring
Related issues
Edited by Douglas Barbosa Alexandre