From c0178c3df15def0018d4bb0fbb9f184ec8671fa6 Mon Sep 17 00:00:00 2001 From: Kevin Albertson Date: Thu, 9 Nov 2017 07:43:13 -0500 Subject: [PATCH] DOCS-10992 capped commands take DB_X locks --- source/core/capped-collections.txt | 2 +- source/faq/concurrency.txt | 2 ++ source/includes/fact-database-lock.rst | 4 ++++ source/reference/command/cloneCollectionAsCapped.txt | 4 +++- source/reference/command/convertToCapped.txt | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 source/includes/fact-database-lock.rst diff --git a/source/core/capped-collections.txt b/source/core/capped-collections.txt index 762f517a89c..9f9bbbdae83 100644 --- a/source/core/capped-collections.txt +++ b/source/core/capped-collections.txt @@ -186,7 +186,7 @@ the :dbcommand:`convertToCapped` command: The ``size`` parameter specifies the size of the capped collection in bytes. -.. include:: /includes/warning-blocking-global.rst +.. include:: /includes/fact-database-lock.rst Automatically Remove Data After a Specified Period of Time ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/faq/concurrency.txt b/source/faq/concurrency.txt index 3ea85e45be4..d9475e15f41 100644 --- a/source/faq/concurrency.txt +++ b/source/faq/concurrency.txt @@ -184,6 +184,8 @@ lock at the database level for extended periods: - :method:`db.collection.validate()`, and - :method:`db.copyDatabase()`. This operation may lock all databases. See :ref:`faq-concurrency-lock-multiple-dbs`. +- :dbcommand:`convertToCapped` +- :dbcommand:`cloneCollectionAsCapped` The following administrative commands lock the database but only hold the lock for a very short time: diff --git a/source/includes/fact-database-lock.rst b/source/includes/fact-database-lock.rst new file mode 100644 index 00000000000..bed41acba93 --- /dev/null +++ b/source/includes/fact-database-lock.rst @@ -0,0 +1,4 @@ +This holds a database exclusive lock for the duration of the operation. +Other operations which lock the same database will be blocked until the +operation completes. See :ref:`faq-concurrency-operations-locks` for +operations that lock the database. \ No newline at end of file diff --git a/source/reference/command/cloneCollectionAsCapped.txt b/source/reference/command/cloneCollectionAsCapped.txt index de7facd45b6..90004a20153 100644 --- a/source/reference/command/cloneCollectionAsCapped.txt +++ b/source/reference/command/cloneCollectionAsCapped.txt @@ -55,7 +55,7 @@ Definition distinct and cannot be the same as that of the original existing collection. - * - size + * - ``size`` - number - Maximum size of the capped collection. @@ -92,3 +92,5 @@ Behavior If the ``capped size`` is less than the size of the source collection, then not all documents in the source collection will exist in the destination capped collection. + +.. include:: /includes/fact-database-lock.rst diff --git a/source/reference/command/convertToCapped.txt b/source/reference/command/convertToCapped.txt index f5ef3f76e32..4d4ee1c5c2e 100644 --- a/source/reference/command/convertToCapped.txt +++ b/source/reference/command/convertToCapped.txt @@ -84,6 +84,8 @@ command exhibits the following behavior: - :dbcommand:`renameCollection` renames the new capped collection to the name of the original collection. + - .. include:: /includes/fact-database-lock.rst + .. note:: MongoDB does not support the :dbcommand:`convertToCapped`