Skip to content

Commit 6a7d19c

Browse files
author
A. Jesse Jiryu Davis
committed
Warn about secondaryPreferred possibly redirecting too much traffic to primary
1 parent 5510069 commit 6a7d19c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/applications/replication.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,16 @@ using non-:readmode:`primary` read preference modes:
621621
direct connection to a :ref:`hidden member
622622
<replica-set-hidden-members>` of the set.
623623

624+
.. warning::
625+
626+
Although it is tempting to use :readmode:`secondaryPreferred` to distribute
627+
load, if your primary cannot accept your full read load, then
628+
using :readmode:`secondaryPreferred` is dangerous: if all secondaries
629+
become unavailable, but you have enough arbiters to prevent the primary from
630+
stepping down, then this mode will redirect traffic to the primary. For this
631+
reason, use :readmode:`secondary` to distribute load,
632+
not :readmode:`secondaryPreferred`.
633+
624634
- Providing local reads for geographically distributed applications.
625635

626636
If you have application servers in multiple data centers, you may

0 commit comments

Comments
 (0)