Skip to content

Commit 1252158

Browse files
authored
DOCS 15330 opportunistic reads - Backport v5.0 (#1862)
* DOCS-15330 opportunisticSecondaryTargeting (#1824) * DOCS-15330 Adds server parameter * DOCS-15330 Updates description * DOCS-15330 Updates notice * DOCS-15330 Updates metadata * DOCS-15330 Updates notice * DOCS-15330 Fixes per Joe * DOCS-15330 Fixes per Joe * DOCS-15330 Fixes per Vojislav * DOCS-15330 Sets version per Jira
1 parent e066f74 commit 1252158

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

source/reference/parameters.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,6 +2778,41 @@ Sharding Parameters
27782778
- :serverstatus:`shardedIndexConsistency` metrics returned by the
27792779
:dbcommand:`serverStatus` command.
27802780

2781+
.. parameter:: opportunisticSecondaryTargeting
2782+
2783+
.. versionadded:: 5.0.10
2784+
2785+
*Type*: boolean
2786+
2787+
*Default*: ``false``
2788+
2789+
|mongos-only|
2790+
2791+
Determines whether ``mongos`` performs opportunistic reads against
2792+
replica sets.
2793+
2794+
When this parameter is set to ``true``, :program:`mongos` directs secondary
2795+
reads to secondaries with active connections. It sends the request to the
2796+
first secondary that accepts the connection. When this parameter is set to
2797+
``false``, :program:`mongos` holds secondary reads until it can establish
2798+
a connection to a specific secondary, (except in the case of
2799+
:ref:`hedged reads <read-preference-hedged-read>`).
2800+
2801+
.. note::
2802+
2803+
Under certain workloads, opportunistic reads may trigger the
2804+
opening of unnecessary connections from :program:`mongos` to
2805+
:program:`mongod` and reduce overall performance.
2806+
This parameter should not be enabled unless your application has
2807+
a specific need for the feature.
2808+
2809+
For example, to set ``opportunisticSecondaryTargeting`` during startup:
2810+
2811+
.. code-block:: bash
2812+
2813+
mongos --setParameter opportunisticSecondaryTargeting=true
2814+
2815+
27812816
.. parameter:: shardedIndexConsistencyCheckIntervalMS
27822817

27832818
*New in version 4.4 (and 4.2.6).*

0 commit comments

Comments
 (0)