Skip to content

GODRIVER-1528 retryableWrites spec improvements #336

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

Merged
merged 3 commits into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions data/retryable-writes/bulkWrite-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["update"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "bulkWrite"
arguments:
Expand Down Expand Up @@ -61,7 +61,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "bulkWrite"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/deleteOne-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["delete"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "deleteOne"
arguments:
Expand All @@ -40,7 +40,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "deleteOne"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/findOneAndDelete-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["findAndModify"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "findOneAndDelete"
arguments:
Expand All @@ -40,7 +40,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "findOneAndDelete"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/findOneAndReplace-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["findAndModify"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "findOneAndReplace"
arguments:
Expand All @@ -42,7 +42,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "findOneAndReplace"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/findOneAndUpdate-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["findAndModify"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "findOneAndUpdate"
arguments:
Expand All @@ -42,7 +42,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "findOneAndUpdate"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/insertMany-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "insertMany"
arguments:
Expand All @@ -44,7 +44,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "insertMany"
arguments:
Expand Down
47 changes: 47 additions & 0 deletions data/retryable-writes/insertOne-serverErrors.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,53 @@
}
}
},
{
"description": "InsertOne fails after connection failure when retryWrites option is false",
"clientOptions": {
"retryWrites": false
},
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"closeConnection": true
}
},
"operation": {
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "InsertOne succeeds after NotMaster",
"failPoint": {
Expand Down
56 changes: 40 additions & 16 deletions data/retryable-writes/insertOne-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ tests:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }
-
description: "InsertOne fails after connection failure when retryWrites option is false"
clientOptions:
retryWrites: false
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
data:
failCommands: ["insert"]
closeConnection: true
operation:
name: "insertOne"
arguments:
document: { _id: 3, x: 33 }
outcome:
error: true
result:
# If retryWrites is false, the driver should not add the
# RetryableWriteError label to the error.
errorLabelsOmit: ["RetryableWriteError"]
collection:
data:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
-
description: "InsertOne succeeds after NotMaster"
failPoint:
Expand All @@ -39,7 +63,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 10107
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -61,7 +85,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 13436
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -83,7 +107,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 13435
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -105,7 +129,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 11602
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -127,7 +151,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 11600
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -149,7 +173,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -171,7 +195,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 91
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -193,7 +217,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 7
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -215,7 +239,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 6
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -237,7 +261,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 9001
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -259,7 +283,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 89
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand All @@ -281,7 +305,7 @@ tests:
data:
failCommands: ["insert"]
errorCode: 262
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
closeConnection: false
operation:
name: "insertOne"
Expand Down Expand Up @@ -326,7 +350,7 @@ tests:
writeConcernError:
code: 11600
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "insertOne"
arguments:
Expand All @@ -349,7 +373,7 @@ tests:
writeConcernError:
code: 11602
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "insertOne"
arguments:
Expand All @@ -372,7 +396,7 @@ tests:
writeConcernError:
code: 189
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "insertOne"
arguments:
Expand All @@ -395,7 +419,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "insertOne"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/replaceOne-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["update"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "replaceOne"
arguments:
Expand All @@ -44,7 +44,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "replaceOne"
arguments:
Expand Down
4 changes: 2 additions & 2 deletions data/retryable-writes/updateOne-serverErrors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
data:
failCommands: ["update"]
errorCode: 189
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "updateOne"
arguments:
Expand All @@ -44,7 +44,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
operation:
name: "updateOne"
arguments:
Expand Down
2 changes: 1 addition & 1 deletion data/transactions/error-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ tests:
data:
failCommands: ["commitTransaction"]
errorCode: 11602 # InterruptedDueToReplStateChange
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]

operations:
- name: startTransaction
Expand Down
2 changes: 1 addition & 1 deletion data/transactions/mongos-recovery-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ tests:
writeConcernError:
code: 91
errmsg: Replication is being shut down
errorLabels: ["RetryableWriteError"] # SPEC-1565
errorLabels: ["RetryableWriteError"]
# The client sees a retryable writeConcernError on the first
# commitTransaction due to the fail point but it actually succeeds on the
# server (SERVER-39346). The retry will succeed both on a new mongos and
Expand Down
Loading