Skip to content

Commit b7eed97

Browse files
author
Bob Grabar
committed
DOCS-871 multithreaded replication
1 parent 0b34793 commit b7eed97

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

source/core/replication-internals.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,22 @@ behaviors:
304304
value, either ``true`` or ``false``, for the
305305
:data:`members[n].buildIndexes` field.
306306

307+
Multithreaded Replication
308+
-------------------------
309+
310+
MongoDB supports multithreaded replication by applying write operations
311+
on secondary nodes in batches. Each batch is divided among many threads.
312+
The multithreaded writes allow for concurrent CPU usage.
313+
314+
Despite the multithreaded writes, reads on secondaries do not "see"
315+
operations applied out of order. While the threads are writing, MongoDB
316+
blocks read operations, even if the write operations yield.
317+
318+
Before writing a batch of oplog operations, MongoDB fetches all the
319+
memory pages that contain the data and indexes to be written. The
320+
prefetch stage minimizes the amount of time MongoDB must hold the write
321+
lock to apply operations.
322+
307323
Pre-Fetching Indexes to Improve Replication Throughput
308324
------------------------------------------------------
309325

0 commit comments

Comments
 (0)