-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
3
-
🟦 Shard Catalog
-
None
-
None
-
None
-
None
-
None
-
None
Currently, shard catalog initialization is spread all over the place and hard to understand.
To put an example, catalog::closeCatalog and catalog::openCatalog are only ever used as part of replication rollback (but the name doesn't suggest so).
The startup path (new cluster or opening existing dbpath) goes through
startUpStorageEngineAndCollectionCatalog, however, this method is very confusing, because catalog::initializeCollectionCatalog actually doesn't leave the CollectionCatalog consistent. At this point the Collection instances have been created, but not the indexes (even if the durable metadata passed in contained indexes). Index catalog instantiation happens when databases are opened and collection instances initialised, during startupRecovery.
We should try to refactor / rename some of these methods to make the startup path more understandable.