Nodes can throw ErrorCodes::NamespaceNotFound for existing collections while trying to resolve UUID to namespace when the node is shutting down and has finished deregistering all the collections and clearing the CollectionCatalog::_catlog map from the in-memory collection catalog. There are few commands, like, count, tries to resolve UUID to namespace as part of the authorization check without holding any locks. ErrorCodes::NamespaceNotFound makes the multi-tenant migration protocol to skip cloning the collection from donor to recipient as the recipient assumes that the collection was dropped on the donor. And, the tenant migration may still go ahead and commit without copying all collections of the tenant from donor to recipient and leading to data corruption.
Note: This a problem with logical initial sync as well.
- is related to
-
SERVER-33632 Make UUID catalog reload atomic
- Closed
-
SERVER-69627 Clean up catalog close and storage engine shutdown logic
- Blocked