Skip to content

Commit c33f502

Browse files
author
Sam Kleinman
committed
DOCS-3286: clarification about map reduce lock during reduce phase
1 parent a11214d commit c33f502

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

source/core/map-reduce-concurrency.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ During the operation, map-reduce takes the following locks:
2020
collection takes a write lock.
2121

2222
- If the output collection exists, then the output actions (i.e.
23-
``merge``, ``replace``, ``reduce``) take a write lock.
23+
``merge``, ``replace``, ``reduce``) take a write lock. This write
24+
lock is *global*, and blocks all operations on the :program:`mongod`
25+
instance.
2426

2527
.. versionchanged:: 2.4
2628
The V8 JavaScript engine, which became the default in 2.4, allows
@@ -29,9 +31,10 @@ During the operation, map-reduce takes the following locks:
2931
functions) executed in a single thread.
3032

3133
.. note::
32-
3334
The final write lock during post-processing makes the results appear
3435
atomically. However, output actions ``merge`` and ``reduce`` may
3536
take minutes to process. For the ``merge`` and ``reduce``, the
36-
``nonAtomic`` flag is available. See the
37-
:method:`db.collection.mapReduce()` reference for more information.
37+
``nonAtomic`` flag is available, which releases the lock between
38+
writing each output
39+
document. the :method:`db.collection.mapReduce()` reference for more
40+
information.

0 commit comments

Comments
 (0)