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 are last_wiki_synced_at is not null and last_wiki_successful_sync_at is not null and resync_wiki = 'f'
  • But RepositoryShardSyncWorker only schedules resync_wiki = 't' and doesn't look at last_wiki_synced_at or last_wiki_successful_sync_at

Here's another inconsistency: failed_wikis are based on wiki_retry_count.

To summarize:

  • synced + unsynced + failed should always equal all
  • But currently this is not guaranteed to be true.

  • Fix the queries
  • Simplify the ProjectRegistry fields? (This sounds daunting)
Edited Mar 27, 2018 by Michael Kozono
Assignee Loading
Time tracking Loading