Skip to content

Commit 44d71db

Browse files
authored
Clarify the RetryableWriteError label logic (#750)
1 parent ce5512d commit 44d71db

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/retryable-writes/retryable-writes.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,16 +214,18 @@ When connected to a MongoDB instance that supports retryable writes (versions 3.
214214
the driver MUST treat all errors with the RetryableWriteError label as retryable.
215215
This label might be added to an error in a variety of ways:
216216

217+
When the driver encounters a network error communicating with any server version
218+
that supports retryable writes, it MUST add a RetryableWriteError label to that
219+
error.
220+
217221
For server versions 4.4 and newer, MongoDB will add a RetryableWriteError label to
218222
errors or server responses that it considers retryable before returning them to the
219223
driver. As new server versions are released, the errors that are labeled with the
220224
RetryableWriteError label may change. When receiving a command result
221225
with an error from a 4.4+ server that supports retryable writes, the driver
222-
MUST NOT add a RetryableWriteError label to that error under any condition.
223-
224-
When the driver encounters a network error communicating with any server version
225-
that supports retryable writes, it MUST add a RetryableWriteError label to that
226-
error.
226+
MUST NOT add a RetryableWriteError label to that error under any condition.
227+
Note: With a WriteConcernError response the top level document or the
228+
WriteConcernError document may contain the RetryableWriteError error label.
227229

228230
When receiving a command result with an error from a pre-4.4 server that supports
229231
retryable writes, the driver MUST add a RetryableWriteError label to errors that meet

0 commit comments

Comments
 (0)