Skip to content

DOCS-14251 add opportunisticSecondaryTargeting v4.2 only #5110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions source/reference/parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,42 @@ Sharding Parameters

- MongoDB 3.4.11+

.. parameter:: opportunisticSecondaryTargeting

.. versionadded:: 4.2.13

|mongos-only|

Type: boolean

Default: false

When ``true``, enables a :binary:`~bin.mongos` to attempt to
establish connections to multiple secondaries and direct the request
to the first secondary that accepts the connection.

.. note::

This feature was introduced in MongoDB 4.2.0 and enabled
by default. Starting in MongoDB 4.2.13, this feature is now
disabled by default. The
:parameter:`opportunisticSecondaryTargeting` parameter is
introduced alongside this change to permit re-enabling this
feature if desired.

The following enables :parameter:`opportunisticSecondaryTargeting`:

.. code-block:: sh

mongos --setParameter opportunisticSecondaryTargeting=true

The parameter may also be set using the :dbcommand:`setParameter`
command:

.. code-block:: javascript

db.adminCommand( { setParameter: 1, opportunisticSecondaryTargeting: true } )

Storage Parameters
~~~~~~~~~~~~~~~~~~

Expand Down