-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:None
The renameCollection command says it is "suitable for production environments:
https://docs.mongodb.com/manual/reference/command/renameCollection/#behavior
.. and then highlights two caveats that contradict this:
- renameCollection blocks all database activity for the duration of the operation.
- renameCollection is not compatible with sharded collections.
The most important warning is lurking below the example:
This command obtains a global write lock and will block other operations until it has completed.
I think this should not be recommended for production environments and the warning on global lock should be prominently featured. An initial skim of the "blocks all database activity" point might suggest that this only blocks activity for the current database rather than globally.
Note: SERVER-15723 will improve the lock granularity for renames within the same database, but renaming a collection between databases will still involve a global write lock while the data is copied to the target database.
- is duplicated by
-
DOCS-10528 Docs for SERVER-15723: Avoid G_X lock for rename_collection within database
- Closed