The per-collection metadata is owned and managed through the CollectionShardingState class, which has one instance per sharded collection.
All retrieval of collection metadata should go through this class so it can enforce proper locking rules and we should remove calls to ShardingState::getCollectionMetadata, which does not check for locks.
- depends on
-
SERVER-23073 Aggregation checks the output collection's sharding state without collection lock
- Closed
- is depended on by
-
SERVER-25061 Make CollectionShardingState a decoration on Collection
- Closed
- is related to
-
SERVER-37750 Optimized $sample stage does not yield
- Closed