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 @@ -2632,6 +2632,41 @@ Sharding Parameters
2632
2632
- :serverstatus:`shardedIndexConsistency` metrics returned by the
2633
2633
:dbcommand:`serverStatus` command.
2634
2634
2635
+ .. parameter:: opportunisticSecondaryTargeting
2636
+
2637
+ .. versionadded:: 4.4.15
2638
+
2639
+ *Type*: boolean
2640
+
2641
+ *Default*: ``false``
2642
+
2643
+ |mongos-only|
2644
+
2645
+ Determines whether ``mongos`` performs opportunistic reads against
2646
+ replica sets.
2647
+
2648
+ When this parameter is set to ``true``, :program:`mongos` directs secondary
2649
+ reads to secondaries with active connections. It sends the request to the
2650
+ first secondary that accepts the connection. When this parameter is set to
2651
+ ``false``, :program:`mongos` holds secondary reads until it can establish
2652
+ a connection to a specific secondary, (except in the case of
2653
+ :ref:`hedged reads <read-preference-hedged-read>`).
2654
+
2655
+ .. note::
2656
+
2657
+ Under certain workloads, opportunistic reads may trigger the
2658
+ opening of unnecessary connections from :program:`mongos` to
2659
+ :program:`mongod` and reduce overall performance.
2660
+ This parameter should not be enabled unless your application has
2661
+ a specific need for the feature.
2662
+
2663
+ For example, to set ``opportunisticSecondaryTargeting`` during startup:
2664
+
2665
+ .. code-block:: bash
2666
+
2667
+ mongos --setParameter opportunisticSecondaryTargeting=true
2668
+
2669
+
2635
2670
.. parameter:: shardedIndexConsistencyCheckIntervalMS
2636
2671
2637
2672
*New in version 4.4 (and 4.2.6).*
You can’t perform that action at this time.
0 commit comments