Fix the query used for discovering overdue mirrors
The query in Gitlab::Exporter::Database::RowCountCollector
to find overdue mirrors is using namespaces.plan_id
to determine the plan of a mirror.
This column is not used, so the query is incorrect: gitlab-org/gitlab#196862 (closed). We'll need find the gitlab_subscription
of the root namespace as @smcgivern illustrated in gitlab-org/gitlab#212074 (comment 309489162)
We can do this by extracting the query from UpdateAllMirrorsWorker#pull_mirrors_batch
into SQL to use in our exporter.
Edited by Sean McGivern