Skip to content

Commit 3fe7091

Browse files
authored
DOCS-15330 opportunistic reads backport v6.0 (#1860)
* 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 * DOCSP-15330 Version updated per Jira
1 parent a8aef7e commit 3fe7091

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
@@ -3060,6 +3060,41 @@ Sharding Parameters
30603060
- :serverstatus:`shardedIndexConsistency` metrics returned by the
30613061
:dbcommand:`serverStatus` command.
30623062

3063+
.. parameter:: opportunisticSecondaryTargeting
3064+
3065+
.. versionadded:: 6.0.0
3066+
3067+
*Type*: boolean
3068+
3069+
*Default*: ``false``
3070+
3071+
|mongos-only|
3072+
3073+
Determines whether ``mongos`` performs opportunistic reads against
3074+
replica sets.
3075+
3076+
When this parameter is set to ``true``, :program:`mongos` directs secondary
3077+
reads to secondaries with active connections. It sends the request to the
3078+
first secondary that accepts the connection. When this parameter is set to
3079+
``false``, :program:`mongos` holds secondary reads until it can establish
3080+
a connection to a specific secondary, (except in the case of
3081+
:ref:`hedged reads <read-preference-hedged-read>`).
3082+
3083+
.. note::
3084+
3085+
Under certain workloads, opportunistic reads may trigger the
3086+
opening of unnecessary connections from :program:`mongos` to
3087+
:program:`mongod` and reduce overall performance.
3088+
This parameter should not be enabled unless your application has
3089+
a specific need for the feature.
3090+
3091+
For example, to set ``opportunisticSecondaryTargeting`` during startup:
3092+
3093+
.. code-block:: bash
3094+
3095+
mongos --setParameter opportunisticSecondaryTargeting=true
3096+
3097+
30633098
.. parameter:: shardedIndexConsistencyCheckIntervalMS
30643099

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

0 commit comments

Comments
 (0)