Fix inconsistencies in `ProjectRegistry` queries
From https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5104#note_64850154:
The meaning of some
ProjectRegistryfields overlap, so there isn't a SSOT, which has opened us up to inconsistencies in the queries.
synced_wikisarelast_wiki_synced_at is not null and last_wiki_successful_sync_at is not null and resync_wiki = 'f'- But
RepositoryShardSyncWorkeronly schedulesresync_wiki = 't'and doesn't look atlast_wiki_synced_atorlast_wiki_successful_sync_at
Here's another inconsistency: failed_wikis are based on wiki_retry_count.
To summarize:
-
synced+unsynced+failedshould always equalall - But currently this is not guaranteed to be true.
-
Fix the queries -
Simplify the ProjectRegistryfields? (This sounds daunting)
Edited by Michael Kozono