Add rake task to classify dead-shard pool repository members

What does this MR do and why?

Adds a read-only rake task (gitlab:pool_repositories:classify_dead_shard_members) that classifies member projects of sourceless pool repositories sitting on decommissioned Gitaly shards.

Per the Phase 2 remediation plan, 133 pool_repositories rows on dead shards still have ~172 member projects pointing at them. Before remediation, each member project must be classified by querying Gitaly to determine its on-disk state:

  • Self-contained: repo is complete, no pool needed on disk
  • Silently linked: repo is linked to an on-disk pool on its current shard (storage move replicated the pool but DB bookkeeping was incomplete)
  • Broken: repo is missing or has missing objects

The rake task outputs a CSV with per-project classifications to guide the subsequent remediation steps.

Usage

# Omnibus (production)
sudo gitlab-rake gitlab:pool_repositories:classify_dead_shard_members \
  SHARD_NAMES=nfs-file01,...,nfs-file110,praefect-file01 \
  OUTPUT_FILE=/tmp/classification.csv

# Source / GDK (requires PostgreSQL to be running: `gdk start postgresql`)
bundle exec rake gitlab:pool_repositories:classify_dead_shard_members \
  SHARD_NAMES=nfs-file01,...,nfs-file110,praefect-file01 \
  OUTPUT_FILE=/tmp/classification.csv

Sample output (local GDK)

Local GDK has no dead-shard data, so the task completes with zero results — confirming it runs end-to-end without errors:

I, [2026-09-10T18:02:59.953167 #70808]  INFO -- : No matching shards found in database. Nothing to classify.
I, [2026-09-10T18:02:59.953502 #70808]  INFO -- :
I, [2026-09-10T18:02:59.953574 #70808]  INFO -- : === Classification Report ===
I, [2026-09-10T18:02:59.953592 #70808]  INFO -- : Self-contained: 0
I, [2026-09-10T18:02:59.953608 #70808]  INFO -- : Silently linked: 0
I, [2026-09-10T18:02:59.953623 #70808]  INFO -- : Broken: 0
I, [2026-09-10T18:02:59.953636 #70808]  INFO -- : Unknown/Error: 0
I, [2026-09-10T18:02:59.953657 #70808]  INFO -- : Total: 0
I, [2026-09-10T18:02:59.954613 #70808]  INFO -- : Classification complete. Results saved to /tmp/classification.csv

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Gloria Odipo

Merge request reports

Loading
Loading