DatabaseImpl::renameCollection uses the onCreateCollection UUID catalog observer, which does not atomically unregister and re-register the UUID of the collection being renamed.
There is a race condition reading while the UUID is not registered to any collection. The recent addition of replaceUUIDCatalogEntry, which atomically swaps the UUIDs, should be used instead.
The other problem of rename using the createCollection UUID catalog observer is tracked by SERVER-35319
- related to
-
SERVER-35319 renameCollection should re-register the source collection's UUID when interrupted
- Closed