From 4a98a1395da5313022014c0b489d87d6fe65fbe7 Mon Sep 17 00:00:00 2001 From: Dmitry Rybakov Date: Mon, 21 Aug 2023 15:51:14 +0200 Subject: [PATCH] Clarify that deprioritized servers are only for sharded --- source/retryable-reads/retryable-reads.rst | 4 ++-- source/retryable-writes/retryable-writes.rst | 6 +++--- source/server-selection/server-selection.rst | 12 ++++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/source/retryable-reads/retryable-reads.rst b/source/retryable-reads/retryable-reads.rst index 0828000e88..49838e3690 100644 --- a/source/retryable-reads/retryable-reads.rst +++ b/source/retryable-reads/retryable-reads.rst @@ -268,7 +268,7 @@ selecting a server for a retry attempt. 3a. Selecting the server for retry '''''''''''''''''''''''''''''''''' -In sharded topology, the server on which the operation failed MUST be provided +In sharded cluster, the server on which the operation failed MUST be provided to the server selection mechanism as a deprioritized server. If the driver cannot select a server for @@ -692,7 +692,7 @@ degraded performance can simply disable ``retryableReads``. Changelog ========= -:2023-08-??: Require that in a sharded topology the server on which the +:2023-08-??: Require that in a sharded cluster the server on which the operation failed MUST be provided to the server selection mechanism as a deprioritized server. :2022-11-09: CLAM must apply both events and log messages. diff --git a/source/retryable-writes/retryable-writes.rst b/source/retryable-writes/retryable-writes.rst index 321c4b0c11..ea0ddabcbb 100644 --- a/source/retryable-writes/retryable-writes.rst +++ b/source/retryable-writes/retryable-writes.rst @@ -395,8 +395,8 @@ of the following conditions is reached: <../client-side-operations-timeout/client-side-operations-timeout.rst#retryability>`__. - CSOT is not enabled and one retry was attempted. -For each retry attempt, drivers MUST select a writable server. In sharded -topology, the server on which the operation failed MUST be provided to +For each retry attempt, drivers MUST select a writable server. In a sharded +cluster, the server on which the operation failed MUST be provided to the server selection mechanism as a deprioritized server. If the driver cannot select a server for a retry attempt @@ -829,7 +829,7 @@ inconsistent with the server and potentially confusing to developers. Changelog ========= -:2023-08-??: Require that in a sharded topology the server on which the +:2023-08-??: Require that in a sharded cluster the server on which the operation failed MUST be provided to the server selection mechanism as a deprioritized server. :2022-11-17: Add logic for persisting "currentError" as "previousError" on first diff --git a/source/server-selection/server-selection.rst b/source/server-selection/server-selection.rst index 85e6b9a2d4..2c8658b154 100644 --- a/source/server-selection/server-selection.rst +++ b/source/server-selection/server-selection.rst @@ -843,9 +843,11 @@ For multi-threaded clients, the server selection algorithm is as follows: 2. If the topology wire version is invalid, raise an error and log a `"Server selection failed" message`_. -3. Find suitable servers by topology type and operation type. In the case of - sharded clusters, a list of deprioritized servers may be provided; +3. Find suitable servers by topology type and operation type. If a list of + deprioritized servers is provided, and the topology is sharded cluster, these servers should be selected only if there are no other suitable servers. + The server selection algorithm MUST ignore the deprioritized servers if the + topology is not sharded cluster. 4. Filter the suitable servers by calling the optional, application-provided server selector. @@ -917,9 +919,11 @@ as follows: 5. If the topology wire version is invalid, raise an error and log a `"Server selection failed" message`_. -6. Find suitable servers by topology type and operation type. In the case of - sharded clusters, a list of deprioritized servers may be provided; +6. Find suitable servers by topology type and operation type. If a list of + deprioritized servers is provided, and the topology is sharded cluster, these servers should be selected only if there are no other suitable servers. + The server selection algorithm MUST ignore the deprioritized servers if the + topology is not sharded cluster. 7. Filter the suitable servers by calling the optional, application-provided server selector.