From 6e97ac99c4965987cf52ef6b93cbb61cf16b312a Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 24 Sep 2012 11:53:23 -0400 Subject: [PATCH 1/3] DOCS-533 add notes/warnings to commands which block db / server --- source/includes/warning-blocking-collection.rst | 5 +++++ source/includes/warning-blocking-database.rst | 5 +++++ source/includes/warning-blocking-global.rst | 5 +++++ source/reference/command/clean.txt | 2 ++ source/reference/command/clone.txt | 4 ++++ source/reference/command/closeAllDatabases.txt | 2 ++ source/reference/command/collMod.txt | 2 ++ source/reference/command/convertToCapped.txt | 2 ++ source/reference/command/copydbgetnonce.txt | 2 ++ source/reference/command/create.txt | 2 ++ source/reference/command/diagLogging.txt | 2 ++ source/reference/command/drop.txt | 2 ++ source/reference/command/dropDatabase.txt | 2 ++ source/reference/command/dropIndexes.txt | 5 ++++- source/reference/command/godinsert.txt | 2 ++ source/reference/command/handshake.txt | 2 +- source/reference/command/profile.txt | 3 +++ source/reference/command/recvChunkStart.txt | 2 ++ source/reference/command/repairDatabase.txt | 2 ++ source/reference/command/resync.txt | 2 ++ source/reference/command/sleep.txt | 4 +++- 21 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 source/includes/warning-blocking-collection.rst create mode 100644 source/includes/warning-blocking-database.rst create mode 100644 source/includes/warning-blocking-global.rst diff --git a/source/includes/warning-blocking-collection.rst b/source/includes/warning-blocking-collection.rst new file mode 100644 index 00000000000..8fdd82439b2 --- /dev/null +++ b/source/includes/warning-blocking-collection.rst @@ -0,0 +1,5 @@ +.. warning:: + + This command obtains a write lock on the affected collection + and will block other operations until it has completed. + diff --git a/source/includes/warning-blocking-database.rst b/source/includes/warning-blocking-database.rst new file mode 100644 index 00000000000..af9ea8ee323 --- /dev/null +++ b/source/includes/warning-blocking-database.rst @@ -0,0 +1,5 @@ +.. warning:: + + This command obtains a write lock on the affected database + and will block other operations until it has completed. + diff --git a/source/includes/warning-blocking-global.rst b/source/includes/warning-blocking-global.rst new file mode 100644 index 00000000000..fac4c992190 --- /dev/null +++ b/source/includes/warning-blocking-global.rst @@ -0,0 +1,5 @@ +.. warning:: + + This command obtains a global write lock and will block other + operations until it has completed. + diff --git a/source/reference/command/clean.txt b/source/reference/command/clean.txt index c721a0059e0..cc277beafad 100644 --- a/source/reference/command/clean.txt +++ b/source/reference/command/clean.txt @@ -7,5 +7,7 @@ clean (internal) .. dbcommand:: clean :dbcommand:`clean` is an internal command. + + .. include:: /includes/warning-blocking-database.rst .. write-lock, slave-ok diff --git a/source/reference/command/clone.txt b/source/reference/command/clone.txt index 2aee24513cb..417adc04628 100644 --- a/source/reference/command/clone.txt +++ b/source/reference/command/clone.txt @@ -33,3 +33,7 @@ clone allow other operations to complete. See :dbcommand:`copydb` for similar functionality. + + .. include:: /includes/warning-blocking-database.rst + +.. TODO: does obtain WRITE lock, does this affect solely origination server? \ No newline at end of file diff --git a/source/reference/command/closeAllDatabases.txt b/source/reference/command/closeAllDatabases.txt index 2d4321214a2..7daaac6385e 100644 --- a/source/reference/command/closeAllDatabases.txt +++ b/source/reference/command/closeAllDatabases.txt @@ -9,3 +9,5 @@ closeAllDatabases (internal) :dbcommand:`closeAllDatabases` is an internal command that invalidates all cursors and closes the open database files. The next operation that uses the database will reopen the file. + + .. include:: /includes/warning-blocking-global.rst diff --git a/source/reference/command/collMod.txt b/source/reference/command/collMod.txt index 609be8a5c4c..4ecce0c7301 100644 --- a/source/reference/command/collMod.txt +++ b/source/reference/command/collMod.txt @@ -36,3 +36,5 @@ collMod :collflag:`usePowerOf2Sizes` is useful for collections where you will be inserting and deleting large numbers of documents to ensure that MongoDB will effectively use space on disk. + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/convertToCapped.txt b/source/reference/command/convertToCapped.txt index 10974b4f5de..0608b7fb691 100644 --- a/source/reference/command/convertToCapped.txt +++ b/source/reference/command/convertToCapped.txt @@ -25,3 +25,5 @@ convertToCapped the original collection on the new collection. If you need indexes on this collection you will need to create these indexes after the conversion is complete. + + .. include:: /includes/warning-blocking-operation.rst diff --git a/source/reference/command/copydbgetnonce.txt b/source/reference/command/copydbgetnonce.txt index 3215bbfb77e..958ba0170a2 100644 --- a/source/reference/command/copydbgetnonce.txt +++ b/source/reference/command/copydbgetnonce.txt @@ -8,5 +8,7 @@ copydbgetnonce (internal) Client libraries use :dbcommand:`copydbgetnonce` to get a one-time password for use with the :dbcommand:`copydb` command. + + .. include:: /includes/warning-blocking-operation.rst .. write-lock, admin-only diff --git a/source/reference/command/create.txt b/source/reference/command/create.txt index 1bce3b6a9b9..e1637056bfd 100644 --- a/source/reference/command/create.txt +++ b/source/reference/command/create.txt @@ -41,3 +41,5 @@ create The :method:`db.createCollection()` provides a wrapper function that provides access to this functionality. + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/diagLogging.txt b/source/reference/command/diagLogging.txt index b9b3229262b..0c34158ffcd 100644 --- a/source/reference/command/diagLogging.txt +++ b/source/reference/command/diagLogging.txt @@ -7,5 +7,7 @@ diagLogging (internal) .. dbcommand:: diagLogging :dbcommand:`diagLogging` is an internal command. + + .. include:: /includes/warning-blocking-database.rst .. write-lock, slave-ok, diff --git a/source/reference/command/drop.txt b/source/reference/command/drop.txt index 5b35be8d675..a6c9c144ca5 100644 --- a/source/reference/command/drop.txt +++ b/source/reference/command/drop.txt @@ -22,3 +22,5 @@ drop Note that this command also removes any indexes associated with the dropped collection. + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/dropDatabase.txt b/source/reference/command/dropDatabase.txt index 4899c748072..404c23b7563 100644 --- a/source/reference/command/dropDatabase.txt +++ b/source/reference/command/dropDatabase.txt @@ -24,4 +24,6 @@ dropDatabase db.dropDatabase(); + .. include:: /includes/warning-blocking-global.rst + .. write-lock diff --git a/source/reference/command/dropIndexes.txt b/source/reference/command/dropIndexes.txt index c1832f22d0a..3a3c566e0b0 100644 --- a/source/reference/command/dropIndexes.txt +++ b/source/reference/command/dropIndexes.txt @@ -6,7 +6,8 @@ dropIndexes .. dbcommand:: dropIndexes - The :dbcommand:`dropIndexes` command drops one or all indexes from the current collection. + The :dbcommand:`dropIndexes` command drops one or all indexes from + the current collection. To drop all indexes, issue the command like so: .. code-block:: javascript @@ -26,3 +27,5 @@ dropIndexes .. code-block:: javascript db.collection.dropIndex("age_1"); + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/godinsert.txt b/source/reference/command/godinsert.txt index 16034ee713d..1aa2035a577 100644 --- a/source/reference/command/godinsert.txt +++ b/source/reference/command/godinsert.txt @@ -7,5 +7,7 @@ godinsert (internal) .. dbcommand:: godinsert :dbcommand:`godinsert` is an internal command for testing purposes only. + + .. include:: /includes/warning-blocking-operation.rst .. write-lock, slave-ok diff --git a/source/reference/command/handshake.txt b/source/reference/command/handshake.txt index e9083ca432f..7b3e6290f4a 100644 --- a/source/reference/command/handshake.txt +++ b/source/reference/command/handshake.txt @@ -8,4 +8,4 @@ handshake (internal) :dbcommand:`handshake` is an internal command. - .. slave-ok + .. slave-ok, no-lock diff --git a/source/reference/command/profile.txt b/source/reference/command/profile.txt index 2e73a9eac93..235b3a087af 100644 --- a/source/reference/command/profile.txt +++ b/source/reference/command/profile.txt @@ -51,3 +51,6 @@ profile shell. .. include:: /includes/note-disable-profiling-fsynclock.rst + + .. include:: /includes/warning-blocking-database.rst + diff --git a/source/reference/command/recvChunkStart.txt b/source/reference/command/recvChunkStart.txt index 37eeda9d919..478957f0ef4 100644 --- a/source/reference/command/recvChunkStart.txt +++ b/source/reference/command/recvChunkStart.txt @@ -8,5 +8,7 @@ recvChunkStart (internal) :dbcommand:`_recvChunkStart` is an internal command. Do not call directly. + + .. include:: /includes/warning-blocking-operation.rst .. admin-only, write-lock diff --git a/source/reference/command/repairDatabase.txt b/source/reference/command/repairDatabase.txt index 8f6abec9fcf..e1985955ea1 100644 --- a/source/reference/command/repairDatabase.txt +++ b/source/reference/command/repairDatabase.txt @@ -40,6 +40,8 @@ repairDatabase line and use the :option:`--repairpath ` switch to specify the folder in which to store the temporary repair files. + + .. include:: /includes/warning-blocking-global.rst This command is accessible via a number of different avenues. You may: diff --git a/source/reference/command/resync.txt b/source/reference/command/resync.txt index fc5d5aa7696..b143c1c6b5e 100644 --- a/source/reference/command/resync.txt +++ b/source/reference/command/resync.txt @@ -10,5 +10,7 @@ resync :program:`mongod` instance to re-synchronize itself. Note that this command is relevant to master-slave replication only. It does no apply to replica sets. + + .. include:: /includes/warning-blocking-operation.rst .. write-lock, slave-ok, admin-only. diff --git a/source/reference/command/sleep.txt b/source/reference/command/sleep.txt index 42c468e4c1c..6cb4ac4294d 100644 --- a/source/reference/command/sleep.txt +++ b/source/reference/command/sleep.txt @@ -7,7 +7,7 @@ sleep (internal) .. dbcommand:: sleep :dbcommand:`sleep` is an internal command for testing purposes. The - :dbcommand:`sleep` command forces the db block all operations. It + :dbcommand:`sleep` command forces the database to block all operations. It takes the following options: .. code-block:: javascript @@ -19,3 +19,5 @@ sleep (internal) seconds. Without arguments, :dbcommand:`sleep`, causes a "read lock" for 100 seconds. + .. include:: /includes/warning-blocking-operation.rst + From b76c685d827fbafb6fe4f56e09ce0fec04b7652b Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Tue, 2 Oct 2012 15:52:59 -0400 Subject: [PATCH 2/3] DOCS-533 document blocking read, write, or global operations --- draft/commands-locks.txt | 217 +++++++++++++++++++ source/reference/command/convertToCapped.txt | 2 +- source/reference/command/copydbgetnonce.txt | 2 +- source/reference/command/godinsert.txt | 2 +- source/reference/command/recvChunkStart.txt | 2 +- source/reference/command/resync.txt | 2 +- source/reference/command/sleep.txt | 5 +- 7 files changed, 226 insertions(+), 6 deletions(-) create mode 100644 draft/commands-locks.txt diff --git a/draft/commands-locks.txt b/draft/commands-locks.txt new file mode 100644 index 00000000000..23cc43df8df --- /dev/null +++ b/draft/commands-locks.txt @@ -0,0 +1,217 @@ +:orphan: + +================== +Commands and Locks +================== + +.. default-domain:: mongodb + +This table is drawn from a review of the MongoDB source, specifically looking for +the presence of: + +.. code-block:: c + + virtual LockType locktype() const { return WRITE; } + virtual bool lockGlobally() const { return true; } + + +.. TODO:: + add admin db requirements + add slave ok + add auth required + ++---------------------------------------------------------+-----------+--------+-------+ +| Command | Lock Type | Scope | Admin | ++=========================================================+===========+========+=======+ +| :dbcommand:`_hashBSONElement` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`_isSelf` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`_recvChunkStart` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`applyOps` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`authenticate` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +|:dbcommand:`availableQueryOptions`, availablequeryoptions| | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`buildInfo`, :dbcommand:`buildinfo` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`captrunc` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`checkShardingIndex` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`clean` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`cloneCollectionAsCapped` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`cloneCollection` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`clone` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`closeAllDatabases` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`cloud` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`collMod` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`collStatus`, :dbcommand:`collstats` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`compact` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`connPoolStats` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`connPoolSync`, :dbcommand:`connpoolsync` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`convertToCapped` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`copydbgetnonce` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`copydb` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`count` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`create` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`cursorInfo` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`dataSize`, :dbcommand:`datasize` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`dbHash`, :dbcommand:`dbhash` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`dbStats`, :dbcommand:`dbstats` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`diagLogging` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`dropDatabase` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`dropIndexes` , :dbcommand:`deleteIndexes` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`drop` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`emptycapped` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`eval` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`features` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`filemd5` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`findAndModify`, :dbcommand:`findandmodify` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`forceerror` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`fsync` | ? | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`geoNear` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`geoSearch` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`geoWalk` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getCmdLineOpts` | NONE | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getLastError`, :dbcommand:`getlasterror` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getLog` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getParameter` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getPreverror`, :dbcommand:`getpreverror` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getShardMap` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getShardVersion` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getnonce` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`getoptime` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`godinsert` | NONE | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`group` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`handshake` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`hostInfo` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`isMaster`,ismaster | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`isdbgrid` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`journalLatencyTest` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`listCommands` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`listDatabases`, :dbcommand:`listdatabases` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`logRotate` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`logout` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`mapReduce`, :dbcommand:`mapreduce` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`medianKey` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`moveChunk` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`ping` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`reIndex` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`renameCollection` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`repSetGetStatus` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`repairDatabase` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetFreeze` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetGetRBID` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetGetStatus` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetInitiate` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetMaintenance` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetReconfig` (note: mutex-rsreconfig) | R/W Mutex | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetStepDown` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetSyncFrom` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`replSetTest` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`resetError`, :dbcommand:`reseterror` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`resync` | W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`serverStatus` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`setParameter` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`setShardVersion` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`shardingState` | W | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`sleep` | R or W | global | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`splitChunk` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`splitVector` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`top` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`touch` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`unsetSharding` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`validate` | R | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`whatsmyuri` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`writeBacksQueued` | | | | ++---------------------------------------------------------+-----------+--------+-------+ +| :dbcommand:`writebacklisten` | | | | ++---------------------------------------------------------+-----------+--------+-------+ diff --git a/source/reference/command/convertToCapped.txt b/source/reference/command/convertToCapped.txt index 0608b7fb691..f4cd5ef4262 100644 --- a/source/reference/command/convertToCapped.txt +++ b/source/reference/command/convertToCapped.txt @@ -26,4 +26,4 @@ convertToCapped indexes on this collection you will need to create these indexes after the conversion is complete. - .. include:: /includes/warning-blocking-operation.rst + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/copydbgetnonce.txt b/source/reference/command/copydbgetnonce.txt index 958ba0170a2..a2b26ace780 100644 --- a/source/reference/command/copydbgetnonce.txt +++ b/source/reference/command/copydbgetnonce.txt @@ -9,6 +9,6 @@ copydbgetnonce (internal) Client libraries use :dbcommand:`copydbgetnonce` to get a one-time password for use with the :dbcommand:`copydb` command. - .. include:: /includes/warning-blocking-operation.rst + .. include:: /includes/warning-blocking-database.rst .. write-lock, admin-only diff --git a/source/reference/command/godinsert.txt b/source/reference/command/godinsert.txt index 1aa2035a577..cd77dc872fb 100644 --- a/source/reference/command/godinsert.txt +++ b/source/reference/command/godinsert.txt @@ -8,6 +8,6 @@ godinsert (internal) :dbcommand:`godinsert` is an internal command for testing purposes only. - .. include:: /includes/warning-blocking-operation.rst + .. include:: /includes/warning-blocking-database.rst .. write-lock, slave-ok diff --git a/source/reference/command/recvChunkStart.txt b/source/reference/command/recvChunkStart.txt index 478957f0ef4..1cb5028b17b 100644 --- a/source/reference/command/recvChunkStart.txt +++ b/source/reference/command/recvChunkStart.txt @@ -9,6 +9,6 @@ recvChunkStart (internal) :dbcommand:`_recvChunkStart` is an internal command. Do not call directly. - .. include:: /includes/warning-blocking-operation.rst + .. include:: /includes/warning-blocking-database.rst .. admin-only, write-lock diff --git a/source/reference/command/resync.txt b/source/reference/command/resync.txt index b143c1c6b5e..6f66c839efa 100644 --- a/source/reference/command/resync.txt +++ b/source/reference/command/resync.txt @@ -11,6 +11,6 @@ resync that this command is relevant to master-slave replication only. It does no apply to replica sets. - .. include:: /includes/warning-blocking-operation.rst + .. include:: /includes/warning-blocking-database.rst .. write-lock, slave-ok, admin-only. diff --git a/source/reference/command/sleep.txt b/source/reference/command/sleep.txt index 6cb4ac4294d..41cf41bdd2c 100644 --- a/source/reference/command/sleep.txt +++ b/source/reference/command/sleep.txt @@ -9,6 +9,9 @@ sleep (internal) :dbcommand:`sleep` is an internal command for testing purposes. The :dbcommand:`sleep` command forces the database to block all operations. It takes the following options: + + :param Boolean w: If true, obtain a global write lock. + :param integer secs: Specifies the number of seconds to sleep. .. code-block:: javascript @@ -19,5 +22,5 @@ sleep (internal) seconds. Without arguments, :dbcommand:`sleep`, causes a "read lock" for 100 seconds. - .. include:: /includes/warning-blocking-operation.rst + .. include:: /includes/warning-blocking-global.rst From 668327afedc25463e491ca64a7ea378bfe40edc6 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Tue, 2 Oct 2012 16:53:18 -0400 Subject: [PATCH 3/3] DOCS-533 minor cleanup & verification of correct locks --- source/reference/command/applyOps.txt | 2 ++ source/reference/command/collStats.txt | 2 ++ source/reference/command/convertToCapped.txt | 2 +- source/reference/command/dataSize.txt | 2 ++ source/reference/command/dbStats.txt | 2 ++ source/reference/command/emptyCapped.txt | 2 ++ source/reference/command/filemd5.txt | 1 + source/reference/command/findAndModify.txt | 2 ++ source/reference/command/reIndex.txt | 2 ++ source/reference/command/renameCollection.txt | 2 ++ source/reference/command/replSetReconfig.txt | 7 +++++++ source/reference/command/resync.txt | 2 +- source/reference/command/shardingState.txt | 2 ++ source/reference/command/sleep.txt | 8 +++++++- source/reference/command/top.txt | 2 ++ source/reference/command/validate.txt | 2 ++ 16 files changed, 39 insertions(+), 3 deletions(-) diff --git a/source/reference/command/applyOps.txt b/source/reference/command/applyOps.txt index 7aed5c2fde7..be7bb77162b 100644 --- a/source/reference/command/applyOps.txt +++ b/source/reference/command/applyOps.txt @@ -37,6 +37,8 @@ applyOps (internal) corresponding expected result in the ``res`` field that must match in order to apply the oplog entry. + .. include:: /includes/warning-blocking-global.rst + .. write-lock .. see: DOCS-133; SERVER-4259 diff --git a/source/reference/command/collStats.txt b/source/reference/command/collStats.txt index b3d0c902d0f..6accca47c69 100644 --- a/source/reference/command/collStats.txt +++ b/source/reference/command/collStats.txt @@ -48,3 +48,5 @@ collStats produce unpredictable and unexpected results in some situations. .. seealso:: ":doc:`/reference/collection-statistics`." + + .. READ lock diff --git a/source/reference/command/convertToCapped.txt b/source/reference/command/convertToCapped.txt index f4cd5ef4262..504fd174946 100644 --- a/source/reference/command/convertToCapped.txt +++ b/source/reference/command/convertToCapped.txt @@ -26,4 +26,4 @@ convertToCapped indexes on this collection you will need to create these indexes after the conversion is complete. - .. include:: /includes/warning-blocking-database.rst + .. include:: /includes/warning-blocking-global.rst diff --git a/source/reference/command/dataSize.txt b/source/reference/command/dataSize.txt index 983d2dbcf00..81cce926029 100644 --- a/source/reference/command/dataSize.txt +++ b/source/reference/command/dataSize.txt @@ -22,3 +22,5 @@ dataSize The amount of time required to return :dbcommand:`dataSize` depends on the amount of data in the collection. + + .. read-lock diff --git a/source/reference/command/dbStats.txt b/source/reference/command/dbStats.txt index 8318606a1e6..7185d9c289a 100644 --- a/source/reference/command/dbStats.txt +++ b/source/reference/command/dbStats.txt @@ -27,3 +27,5 @@ dbStats a wrapper around this functionality. See the ":doc:`/reference/database-statistics`" document for an overview of this output. + + .. read-lock diff --git a/source/reference/command/emptyCapped.txt b/source/reference/command/emptyCapped.txt index fdc15290186..0399455fa44 100644 --- a/source/reference/command/emptyCapped.txt +++ b/source/reference/command/emptyCapped.txt @@ -15,3 +15,5 @@ emptycapped This command removes all records from the capped collection named ``events``. + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/filemd5.txt b/source/reference/command/filemd5.txt index 66526f78498..3ce33ddd9c0 100644 --- a/source/reference/command/filemd5.txt +++ b/source/reference/command/filemd5.txt @@ -16,3 +16,4 @@ filemd5 { filemd5: ObjectId("4f1f10e37671b50e4ecd2776"), root: "fs" } + .. read-lock diff --git a/source/reference/command/findAndModify.txt b/source/reference/command/findAndModify.txt index 0fb6eccfb56..8547682f0c5 100644 --- a/source/reference/command/findAndModify.txt +++ b/source/reference/command/findAndModify.txt @@ -87,3 +87,5 @@ findAndModify cluster. :dbcommand:`findAndModify` operations issued against :program:`mongos` instances for non-sharded collections function normally. + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/reIndex.txt b/source/reference/command/reIndex.txt index f4dbaa94c6d..2cba49d8e34 100644 --- a/source/reference/command/reIndex.txt +++ b/source/reference/command/reIndex.txt @@ -26,3 +26,5 @@ reIndex .. code-block:: javascript db.collection.reIndex(); + + .. include:: /includes/warning-blocking-database.rst diff --git a/source/reference/command/renameCollection.txt b/source/reference/command/renameCollection.txt index b276cc8f9ce..285c20e7657 100644 --- a/source/reference/command/renameCollection.txt +++ b/source/reference/command/renameCollection.txt @@ -42,3 +42,5 @@ renameCollection .. warning:: You cannot use :dbcommand:`renameCollection` with sharded collections. + + .. include:: /includes/warning-blocking-global.rst diff --git a/source/reference/command/replSetReconfig.txt b/source/reference/command/replSetReconfig.txt index a37801f597c..ce09a5c9660 100644 --- a/source/reference/command/replSetReconfig.txt +++ b/source/reference/command/replSetReconfig.txt @@ -49,4 +49,11 @@ replSetReconfig the members of the replica set. When this happens, the set will drop all current connections. + + .. note:: + + The :dbcommand:`replSetReconfig` command will obtain a mutually + exclusive lock to prevent multiple replSetReconfig operations + from occurring at the same time. + .. slave-ok, admin-only diff --git a/source/reference/command/resync.txt b/source/reference/command/resync.txt index 6f66c839efa..14a7b66d55c 100644 --- a/source/reference/command/resync.txt +++ b/source/reference/command/resync.txt @@ -11,6 +11,6 @@ resync that this command is relevant to master-slave replication only. It does no apply to replica sets. - .. include:: /includes/warning-blocking-database.rst + .. include:: /includes/warning-blocking-global.rst .. write-lock, slave-ok, admin-only. diff --git a/source/reference/command/shardingState.txt b/source/reference/command/shardingState.txt index 9053d5636f7..a437542ce83 100644 --- a/source/reference/command/shardingState.txt +++ b/source/reference/command/shardingState.txt @@ -14,4 +14,6 @@ shardingState { shardingState: 1 } + .. include:: /includes/warning-blocking-database.rst + .. admin-only diff --git a/source/reference/command/sleep.txt b/source/reference/command/sleep.txt index 41cf41bdd2c..be9169a01b7 100644 --- a/source/reference/command/sleep.txt +++ b/source/reference/command/sleep.txt @@ -22,5 +22,11 @@ sleep (internal) seconds. Without arguments, :dbcommand:`sleep`, causes a "read lock" for 100 seconds. - .. include:: /includes/warning-blocking-global.rst + .. warning:: + This command obtains a global read or write lock depending on + the options specified and will block other operations until + it has completed. + + + .. read-lock, write-lock, global-lock diff --git a/source/reference/command/top.txt b/source/reference/command/top.txt index 07c47aead0c..d5f3f409b6b 100644 --- a/source/reference/command/top.txt +++ b/source/reference/command/top.txt @@ -48,3 +48,5 @@ top You must issue the :dbcommand:`buildInfo` command against the ``admin`` database. + +.. read-lock diff --git a/source/reference/command/validate.txt b/source/reference/command/validate.txt index 03c9591b8e6..fe575cc863a 100644 --- a/source/reference/command/validate.txt +++ b/source/reference/command/validate.txt @@ -41,3 +41,5 @@ validate impact on the performance of your MongoDB instance. .. TODO link to the document with these statistics + + .. read-lock