-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
CAR Team 2024-09-30, CAR Team 2024-10-14, CAR Team 2024-10-28, CAR Team 2024-11-11, CAR Team 2024-11-25
-
2
SERVER-94487 showed that the API offered through the Acquisitions for a writable collection is prone to misuse.
Currently there are various ways to get a writable collection:
- AutoGetCollection::getWritableCollection returns a non-const Collection instance and updates the internal CollectionPtr to point to it.
- CollectionWriter is an adaptor over AutoGetCollection/CollecitonAcquisition that implicitly guarantees the underlying CollectionPtr will get updated once it goes out of scope.
- CollectionCatalog::lookup*ForMetadataWrite returns a non-const Collection instance
Ideally we would want users to only have one way of creating a writable collection via the CollectionWriter and to enforce no usage of the old CollectionPtr while the writer is in scope.
To help users go through the expected path we should also offer some discoverability option in the acquisition API such that we can get a CollectionWriter from an existing AutoGet/Acquisition as a helper method.
- is related to
-
SERVER-94487 collMod refreshes catalog with index entry from older catalog state
- Closed