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