-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Catalog and Routing
There is an ensureDb() function but no equivalent to ensureCollection.
There are workarounds being used throughout the code to wrap the AutoGetCollection in a boost::optional to be able to re-construct it after the collection has been created.
Other places just uses the raw Collection* from the AutoGetCollection so it can be set to a newly created Collection and the AutoGetCollection is just used to hold the locks in that case.
With lock free reads the latter approach could be dangerous as the extracted Collection pointer may dangle after a writable collection is requested or we yield inside query.
A new flag to AutoGetCollection to create collections if not existing could streamline and simplify code in many places.
- is related to
-
SERVER-50984 Make query yielding aware of AutoGetCollection at high level
- Closed