Skip to content

Commit 375821b

Browse files
committed
DOCSP-6170 secondary reads no longer blocked by replication batches
1 parent 265b154 commit 375821b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

source/core/replica-set-sync.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,20 @@ improve concurrency. MongoDB groups batches by document id (:ref:`WiredTiger
115115
operations using a different thread. MongoDB always applies write
116116
operations to a given document in their original write order.
117117

118-
While applying a batch, MongoDB blocks all read operations. As a
119-
result, secondary read queries can never return data that reflect a
120-
state that never existed on the primary.
118+
.. versionchanged:: 4.0
119+
120+
Starting in MongoDB 4.0, read operations that
121+
:ref:`target secondaries <replica-set-read-preference>` and are
122+
configured with a :ref:`read concern<read-concern>` level of
123+
:readconcern:`"local"` or :readconcern:`"majority"` will now read from
124+
a :ref:`WiredTiger<storage-wiredtiger>` snapshot of the data if the read
125+
takes place on a secondary where replication batches are being applied.
126+
Reading from a snapshot guarantees a consistent view of the
127+
data, and allows the read to occur simultaneously with the ongoing
128+
replication without the need for a lock. As a result, secondary reads
129+
requiring these read concern levels no longer need to wait for
130+
replication batches to be applied, and can be handled as they are
131+
received.
121132

122133
Flow Control
123134
~~~~~~~~~~~~

0 commit comments

Comments
 (0)