Skip to content

Commit 1f8158f

Browse files
author
Sam Kleinman
committed
DOCS-871: edits
1 parent a9f325f commit 1f8158f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

source/core/replication-internals.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,18 +289,20 @@ behaviors:
289289
Multithreaded Replication
290290
-------------------------
291291

292-
MongoDB supports multithreaded replication by applying write operations
293-
on secondary nodes in batches. Each batch is divided among many threads.
294-
The multithreaded writes allow for concurrent CPU usage.
295-
296-
Despite the multithreaded writes, reads on secondaries do not "see"
297-
operations applied out of order. While the threads are writing, MongoDB
298-
blocks read operations, even if the write operations yield.
299-
300-
Before writing a batch of oplog operations, MongoDB fetches all the
301-
memory pages that contain the data and indexes to be written. The
302-
prefetch stage minimizes the amount of time MongoDB must hold the write
303-
lock to apply operations.
292+
MongoDB applies write operations in batches using a multithreaded
293+
approach. The replication process divides each batch among a group of
294+
threads which apply many operations with greater concurrency.
295+
296+
Even though threads may apply operations out of order, a client
297+
reading data from a secondary will never return documents that reflect
298+
an in-between state that never existed on the primary. To ensure this
299+
consistency, MongoDB blocks all read operations while applying the
300+
batch of operations
301+
302+
To help improve the performance of operation application, MongoDB
303+
fetches all the memory pages that hold data and indexes that the
304+
operations in the batch will affect. The prefetch stage minimizes the
305+
amount of time MongoDB must hold the write lock to apply operations.
304306

305307
Pre-Fetching Indexes to Improve Replication Throughput
306308
------------------------------------------------------

0 commit comments

Comments
 (0)