-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When a DB primary shard owns no chunks for a given collection, it cannot distinguish between two cases:
- The router's request is valid: the collection is unsharded and resides on this shard.
- The router’s request is stale: the collection has since become tracked, but no chunks have been assigned to this shard.
To disambiguate this, when a collection is tracked but the DB primary shard holds no chunks, we persist a sentinel <0,0> token entry in config.shard.catalog.chunks on the DB primary shard.
The following DDLs are responsible for guaranteeing that the <0,0> token is present on the DB primary shard whenever it holds no chunks for a tracked collection:
- moveChunk (outside the scope of this project): must create the token when the last chunk is moved away from the DB primary shard.
The <0,0> token is removed when the collection is dropped or when the DB primary shard acquires at least one chunk for the collection (at which point the real chunk entries supersede it).