-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
2
The function currently contains lots of logics of handling change stream, holding _kShardMembershipLock and performing existence & draining checks, and actually committing the transaction of writing to sharding catalog for the database creation. It is used to both the old and new database creation paths as a whole since it cannot be easily broken down into smaller free functions. After the change stream handling is removed, we should revisit and consider doing at least:
- Breaking it down into free functions to remove createDatabase coordinator's dependency on sharding catalog manager
- Remove unnecessary parameters like userSelectedPrimary