diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 3d08a01776a..5c1ca8f09e2 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -304,6 +304,22 @@ behaviors: value, either ``true`` or ``false``, for the :data:`members[n].buildIndexes` field. +Multithreaded Replication +------------------------- + +MongoDB supports multithreaded replication by applying write operations +on secondary nodes in batches. Each batch is divided among many threads. +The multithreaded writes allow for concurrent CPU usage. + +Despite the multithreaded writes, reads on secondaries do not "see" +operations applied out of order. While the threads are writing, MongoDB +blocks read operations, even if the write operations yield. + +Before writing a batch of oplog operations, MongoDB fetches all the +memory pages that contain the data and indexes to be written. The +prefetch stage minimizes the amount of time MongoDB must hold the write +lock to apply operations. + Pre-Fetching Indexes to Improve Replication Throughput ------------------------------------------------------