Skip to content

Commit 439049d

Browse files
SPEC-1747 Specify error label in InsertOne test (#852)
1 parent 9146269 commit 439049d

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

source/retryable-writes/retryable-writes.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Retryable Writes
33
================
44

55
:Spec Title: Retryable Writes
6-
:Spec Version: 1.5.2
6+
:Spec Version: 1.5.3
77
:Author: Jeremy Mikola
88
:Lead: \A. Jesse Jiryu Davis
99
:Advisors: Robert Stam, Esha Maharishi, Samantha Ritter, and Kaloian Manassiev
1010
:Status: Accepted
1111
:Type: Standards
1212
:Minimum Server Version: 3.6
13-
:Last Modified: 2020-02-25
13+
:Last Modified: 2020-09-01
1414

1515
.. contents::
1616

@@ -226,9 +226,9 @@ configuration option set to true.
226226
For server versions 4.4 and newer, MongoDB will add a RetryableWriteError label to
227227
errors or server responses that it considers retryable before returning them to the
228228
driver. As new server versions are released, the errors that are labeled with the
229-
RetryableWriteError label may change. When receiving a command result
230-
with an error from a 4.4+ server that supports retryable writes, the driver
231-
MUST NOT add a RetryableWriteError label to that error under any condition.
229+
RetryableWriteError label may change. Drivers MUST NOT add a RetryableWriteError
230+
label to any error derived from a 4.4+ server response (i.e. any error that is not
231+
a network error).
232232

233233
During a retryable write operation on a sharded cluster, mongos may retry the
234234
operation internally, in which case it will not add a RetryableWriteError label to
@@ -807,6 +807,9 @@ inconsistent with the server and potentially confusing to developers.
807807
Changes
808808
=======
809809

810+
2020-09-01: State the the driver should only add the RetryableWriteError label
811+
to network errors when connected to a 4.4+ server.
812+
810813
2020-02-25: State that the driver should only add the RetryableWriteError label
811814
when retryWrites is on, and make it clear that mongos will sometimes perform
812815
internal retries and not return the RetryableWriteError label.

source/retryable-writes/tests/insertOne-serverErrors.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,10 @@
966966
],
967967
"writeConcernError": {
968968
"code": 91,
969-
"errmsg": "Replication is being shut down"
969+
"errmsg": "Replication is being shut down",
970+
"errorLabels": [
971+
"RetryableWriteError"
972+
]
970973
}
971974
}
972975
},

source/retryable-writes/tests/insertOne-serverErrors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ tests:
442442
writeConcernError:
443443
code: 91
444444
errmsg: Replication is being shut down
445+
errorLabels: ["RetryableWriteError"]
445446
operation:
446447
name: "insertOne"
447448
arguments:

0 commit comments

Comments
 (0)