Skip to content

Commit

Permalink
DRIVERS-2170 Server info on retryable errors must reflect the origina…
Browse files Browse the repository at this point in the history
…ting server (#1480)

* DRIVERS-2170 server info on retryable errors must reflect originating server

* update changelogs

* simplify the paragraph
  • Loading branch information
jamis authored Jan 9, 2024
1 parent eef59d9 commit 7145efa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/retryable-reads/retryable-reads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ other error originating from the server, that error should be raised instead as
the caller can infer that an attempt was made and the second error is likely
more relevant (with respect to the current topology state).

If a driver associates server information (e.g. the server address or
description) with an error, the driver MUST ensure that the reported server
information corresponds to the server that originated the error.

4. Implementation constraints
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -705,6 +709,9 @@ degraded performance can simply disable ``retryableReads``.
Changelog
=========
:2023-12-05: Add that any server information associated with retryable
exceptions MUST reflect the originating server, even in the
presence of retries.
:2023-11-30: Add ReadConcernMajorityNotAvailableYet to the list of error codes
that should be retried.
:2023-11-28: Add ExceededTimeLimit to the list of error codes that should
Expand Down
7 changes: 7 additions & 0 deletions source/retryable-writes/retryable-writes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ from the driver) or the error is labeled "NoWritesPerformed", the error from
the previous attempt should be raised. If all server errors are labeled
"NoWritesPerformed", then the first error should be raised.

If a driver associates server information (e.g. the server address or
description) with an error, the driver MUST ensure that the reported server
information corresponds to the server that originated the error.

The above rules are implemented in the following pseudo-code:

.. code-block:: typescript
Expand Down Expand Up @@ -851,6 +855,9 @@ Changelog
=========

:2023-12-06: Clarify that writes are not retried within transactions.
:2023-12-05: Add that any server information associated with retryable
exceptions MUST reflect the originating server, even in the
presence of retries.
:2023-10-02: When CSOT is not enabled, one retry attempt occurs.
:2023-08-26: Require that in a sharded cluster the server on which the
operation failed MUST be provided to the server selection
Expand Down

0 comments on commit 7145efa

Please sign in to comment.