|
This requires some additional ViewCatalog utilities to support lock free reads.
The aggregation code independently of the AutoGetCollectionForRead* helper fetches the ViewCatalog and does lookup() and resolveView() several times. For example.
We need to verify that the ViewCatalog is safe to access multiple times. Perhaps the AutoGetCollectionForRead* helper should save a shared_ptr<ViewCatalog> instance. Accessing the ViewCatalog multiple times across time may not be an inconsistency issue of concern (needs investigation). Alternatively again, maybe a new function on ViewCatalog, like ViewCatalog::getLockFreeState() that will fetch both ViewDefinition and ResolvedView all at once. May need new DatabaseHolder passthrough functions that take dbName and fetch a corresponding Database instance and access the ViewCatalog under an internal mutex's protection.
|