File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -3088,6 +3088,41 @@ Sharding Parameters
3088
3088
- :serverstatus:`shardedIndexConsistency` metrics returned by the
3089
3089
:dbcommand:`serverStatus` command.
3090
3090
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
+
3091
3126
.. parameter:: shardedIndexConsistencyCheckIntervalMS
3092
3127
3093
3128
*New in version 4.4 (and 4.2.6).*
You can’t perform that action at this time.
0 commit comments