-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Sharding EMEA
-
Fully Compatible
-
Sharding EMEA 2023-07-10
-
1
The "OptionalRoutingTableHistory" can be a nullptr for unsharded collections inside of the ChunkManager->_rt. Could we add a more robust method of preventing callers from accidentally calling methods on an unsharded collection? Perhaps invarianting on isSharded() prior to executing the methods that require that to be true. I would prefer that over seg-faulting.
Currently, the only safe-guard against this is a small comment in the header file:
https://github.com/10gen/mongo/blob/ff5e8a16decf26e412ed06261ec92d3bafe82a63/src/mongo/s/chunk_manager.h#L530