Skip to content
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

DRIVERS-1641: pre-4.4 mongos writeConcernError does not determine retryability #1486

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 13 additions & 3 deletions source/retryable-writes/retryable-writes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ The RetryableWriteError label might be added to an error in a variety of ways:
errors that meet the following criteria if the retryWrites option is set to
true on the client performing the relevant operation:

- a server error response with any the following codes:
- a mongod or mongos response with any the following error codes in the
top-level ``code`` field:

.. list-table::
:header-rows: 1
Expand Down Expand Up @@ -284,8 +285,14 @@ The RetryableWriteError label might be added to an error in a variety of ways:
* - ExceededTimeLimit
- 262

- a server response with a write concern error response containing any of the
previously listed codes
- a mongod response with any of the previously listed codes in the
``writeConcernError.code`` field.

Drivers MUST NOT add a RetryableWriteError label based on the following:

- any ``writeErrors[].code`` fields in a mongod or mongos response

- the ``writeConcernError.code`` field in a mongos response

The criteria for retryable errors is similar to the discussion in the SDAM
spec's section on `Error Handling`_, but includes additional error codes. See
Expand Down Expand Up @@ -854,6 +861,9 @@ inconsistent with the server and potentially confusing to developers.
Changelog
=========

:2024-01-02: Do not use ``writeConcernError.code`` in pre-4.4 mongos response to
jmikola marked this conversation as resolved.
Show resolved Hide resolved
determine retryability. Do not use ``writeErrors[].code`` in
pre-4.4 server responses to determine retryability.
: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
Expand Down
303 changes: 303 additions & 0 deletions source/retryable-writes/tests/unified/insertOne-serverErrors.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading