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 @@ -2778,6 +2778,41 @@ Sharding Parameters
2778
2778
- :serverstatus:`shardedIndexConsistency` metrics returned by the
2779
2779
:dbcommand:`serverStatus` command.
2780
2780
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
+
2781
2816
.. parameter:: shardedIndexConsistencyCheckIntervalMS
2782
2817
2783
2818
*New in version 4.4 (and 4.2.6).*
You can’t perform that action at this time.
0 commit comments