-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Catalog and Routing
-
CAR Team 2026-08-03, CAR Team 2026-08-17, CAR Team 2026-08-31, CAR Team 2026-09-14, CAR Team 2026-09-28, CAR Team 2026-10-12, CAR Team 2026-10-26, CAR Team 2026-11-09, CAR Team 2026-11-23, CAR Team 2026-12-07
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Authoritative collection metadata disk recovery currently has a rare two-phase path for empty catalog classification: when config.shard.catalog.{collections,chunks} has no routing table for a namespace, the shard must decide whether to install kUntracked (this shard is the database primary) or kUnowned (this shard is not the database primary).
Today that decision depends on in-memory DSS state rather than durable catalog state alone. The recoverer therefore serializes collection recovery with database metadata mutations:
- Phase A: read collections / chunks from disk via CollectionMetadataSynchronizer.
- If there is no routing table, set needsDbPrimaryClassification and defer installation.
- Phase B: acquire DSS mutex, wait out any database write critical section, snapshot dbPrimary and mutation count, re-read disk, and verify DSS did not change during drain before classifying and committing CSS.
This design has several drawbacks:
- Collection recovery must coordinate with DSS states.
- There's a tin window of time that CSS and DSS mutex are held together.
- Harder to reason about correctness.
- Maintenance burden.