Skip to content

Commit 5b587ab

Browse files
authored
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
1 parent cec60e6 commit 5b587ab

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
@@ -3088,6 +3088,41 @@ Sharding Parameters
30883088
- :serverstatus:`shardedIndexConsistency` metrics returned by the
30893089
:dbcommand:`serverStatus` command.
30903090

3091+
.. parameter:: opportunisticSecondaryTargeting
3092+
3093+
.. versionadded:: 6.1.0
3094+
3095+
*Type*: boolean
3096+
3097+
*Default*: ``false``
3098+
3099+
|mongos-only|
3100+
3101+
Determines whether ``mongos`` performs opportunistic reads against
3102+
replica sets.
3103+
3104+
When this parameter is set to ``true``, :program:`mongos` directs secondary
3105+
reads to secondaries with active connections. It sends the request to the
3106+
first secondary that accepts the connection. When this parameter is set to
3107+
``false``, :program:`mongos` holds secondary reads until it can establish
3108+
a connection to a specific secondary, (except in the case of
3109+
:ref:`hedged reads <read-preference-hedged-read>`).
3110+
3111+
.. note::
3112+
3113+
Under certain workloads, opportunistic reads may trigger the
3114+
opening of unnecessary connections from :program:`mongos` to
3115+
:program:`mongod` and reduce overall performance.
3116+
This parameter should not be enabled unless your application has
3117+
a specific need for the feature.
3118+
3119+
For example, to set ``opportunisticSecondaryTargeting`` during startup:
3120+
3121+
.. code-block:: bash
3122+
3123+
mongos --setParameter opportunisticSecondaryTargeting=true
3124+
3125+
30913126
.. parameter:: shardedIndexConsistencyCheckIntervalMS
30923127

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

0 commit comments

Comments
 (0)