@@ -132,12 +132,14 @@ useful for:
132
132
than the primary or the rest of the set, you may see better
133
133
performance for that application if you use secondary reads.
134
134
135
- Secondary reads also provide graceful degradation in :ref:`failover
136
- <replica-set-failover>` situations. During failover, replica sets may
137
- take 10 seconds or more to new primary member. Because there is no
138
- primary, applications will not be unable to perform primary reads
139
- during this period. With read preference set to read from secondary
140
- members, your application can continue read operations using the
135
+ Secondary reads also provide graceful degradation in
136
+ :ref:`failover <replica-set-failover>` situations. During failover, replica sets may take
137
+ 10 seconds or more to elect a new primary. Because there is no primary,
138
+ applications that can only read from primaries, with the
139
+ :readmode:`primary` read preference mode, are unable to perform reads during this period.
140
+ With read preference configured permit read from secondary
141
+ members, as with the :readmode:`primaryPrefered` read preference mode, your
142
+ application can continue read operations using the
141
143
remaining secondary members.
142
144
143
145
MongoDB :term:`drivers <driver>` allow client applications to
@@ -152,8 +154,8 @@ address read preference configuration and operations.
152
154
153
155
.. note::
154
156
155
- Read preference have no affect on write performance or write
156
- operations . Read preferences only affect the members of the replica
157
+ Read preference only affect which members of the set the application chooses
158
+ to read from . Read preferences only affect the members of the replica
157
159
set that the read operation uses, as well as the consistency of
158
160
query results. Use appropriate :ref:`write concern
159
161
<replica-set-write-concern>` policies to ensure proper data
@@ -180,7 +182,7 @@ All MongoDB drivers :doc:`drivers </applications/drivers>` support the
180
182
following read preference modes. These semantics make it possible to
181
183
specify read preference on a per-collection or per-operation
182
184
basis. The member of the :term:`replica set` that the client read from
183
- can affect type of consistency of the result set. See the :ref:`read
185
+ can affect the consistency of the result set. See the :ref:`read
184
186
preference background <replica-set-read-preference-background>` and
185
187
:ref:`read preference behavior <replica-set-read-preference-behavior>`
186
188
for more information. Also see the :api:`documentation for your driver
@@ -225,9 +227,9 @@ provides access to read preferences, which have the following names.
225
227
226
228
.. readmode:: secondary
227
229
228
- With the :readmode:`secondary` read preference mode, operations
229
- will read from the :term:`secondary` member of the set in most
230
- situations. However, if all secondaries are unavailable , then these
230
+ With the :readmode:`secondary` read preference mode, operations
231
+ will read from the :term:`secondary` member of the set if available.
232
+ However, if there are no secondaries available , then these
231
233
operations will produce an error or exception.
232
234
233
235
Most sets have at least one secondary, but there are situations
@@ -275,6 +277,13 @@ provides access to read preferences, which have the following names.
275
277
specified tag set and directs reads to a random secondary from
276
278
among the :ref:`nearest group <replica-set-read-preference-behavior-nearest>`.
277
279
280
+ .. note::
281
+
282
+ All operations read from the nearest member of the replica set
283
+ that matches the specified read preference mode.
284
+ :readmode:`nearest` prefers low latency reads over a
285
+ member's :term:`primary` or :term:`secondary` status.
286
+
278
287
.. For I/O-bound users who want to distribute reads across all
279
288
members evenly regardless of ping time, set
280
289
secondaryAcceptableLatencyMS very high.
@@ -348,7 +357,7 @@ As a result, MongoDB drivers, and :program:`mongos` will:
348
357
connection is *pinned* to this :program:`mongod`.
349
358
350
359
- attempt to reconnect to a new member, obeying existing :ref:`read
351
- preference mode <replica-set-read-preference-modes>` when it loose a
360
+ preference mode <replica-set-read-preference-modes>` when it lose a
352
361
connection to its :program:`mongod`.
353
362
354
363
These reconnections are transparent to the application itself. If
@@ -359,7 +368,9 @@ As a result, MongoDB drivers, and :program:`mongos` will:
359
368
the state of your database at different moments.
360
369
361
370
- return an error *only* after attempting to connect to three members
362
- of the set. If there are fewer than three members of the set, the
371
+ of the set that match the :term:`read preference mode <replica-set-read-preference-modes>`
372
+ and :ref:`tag set <replica-set-read-preference-tag-sets>`.
373
+ If there are fewer than three members of the set, the
363
374
client will error after connecting to all existing members of the
364
375
set.
365
376
0 commit comments