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 @@ -3060,6 +3060,41 @@ Sharding Parameters
3060
3060
- :serverstatus:`shardedIndexConsistency` metrics returned by the
3061
3061
:dbcommand:`serverStatus` command.
3062
3062
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
+
3063
3098
.. parameter:: shardedIndexConsistencyCheckIntervalMS
3064
3099
3065
3100
*New in version 4.4 (and 4.2.6).*
You can’t perform that action at this time.
0 commit comments