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
GODRIVER-2651 Break NoWritesPerformed-Only Error Sequence #1135
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ed23fee
add a failing test with both definite errors
kevinAlbs 1d30c7b
Merge commit 'ed23feeaaa69e7b7a47c2553c6a7866a595b57d9' into GODRIVER…
prestonvasquez f1ee4d1
GODRIVER-2651 Break NoWritesPerformed-Only Error Sequence
prestonvasquez ae05ad2
GODRIVER-2651 remove prose test
prestonvasquez 5b885fe
GODRIVER-2651 update collection name
prestonvasquez 1ef1195
GODRIVER-2651 set mwv to 4.4
prestonvasquez ab07adb
GODRIVER-2651 update min wire version to 6.0
prestonvasquez e9772db
GODRIVER-2651 fix length typo
prestonvasquez c8edc32
GODRIVER-2651 sync spec tests
prestonvasquez a5be4a0
Merge branch 'master' into GODRIVER-2651
prestonvasquez c7ab007
GODRIVER-2651 clean up branches
prestonvasquez 3312297
GODRIVER-2651 rename typedError to terr
prestonvasquez d97e6d8
GODRIVER-2651 clean up comments
prestonvasquez 482798f
GODRIVER-2651 add license to errors_test
prestonvasquez d4a087b
GODRIVER-2651 create WriteErrors Is method
prestonvasquez 6429404
GODRIVER-2651 remove redundant length check
prestonvasquez 475f7ec
GODRIVER-2651 remove the Error.Is logic
prestonvasquez f958132
Update x/mongo/driver/operation.go
prestonvasquez d5ca59e
Update x/mongo/driver/operation.go
prestonvasquez File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
testdata/retryable-writes/unified/insertOne-noWritesPerformedError.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
description: "retryable-writes insertOne noWritesPerformedErrors" | ||
|
||
schemaVersion: "1.0" | ||
|
||
runOnRequirements: | ||
- minServerVersion: "6.0" | ||
topologies: [ replicaset ] | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
useMultipleMongoses: false | ||
observeEvents: [ commandFailedEvent ] | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &databaseName retryable-writes-tests | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collectionName no-writes-performed-collection | ||
|
||
tests: | ||
- description: "InsertOne fails after NoWritesPerformed error" | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *client0 | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: | ||
times: 2 | ||
data: | ||
failCommands: | ||
- insert | ||
errorCode: 64 | ||
errorLabels: | ||
- NoWritesPerformed | ||
- RetryableWriteError | ||
- name: insertOne | ||
object: *collection0 | ||
arguments: | ||
document: | ||
x: 1 | ||
expectError: | ||
errorCode: 64 | ||
errorLabelsContain: | ||
- NoWritesPerformed | ||
- RetryableWriteError | ||
outcome: | ||
- collectionName: *collectionName | ||
databaseName: *databaseName | ||
documents: [] |
90 changes: 90 additions & 0 deletions
90
testdata/retryable-writes/unified/insertOne-noWritesPerformedErrors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"description": "retryable-writes insertOne noWritesPerformedErrors", | ||
"schemaVersion": "1.0", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "6.0", | ||
"topologies": [ | ||
"replicaset" | ||
] | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0", | ||
"useMultipleMongoses": false, | ||
"observeEvents": [ | ||
"commandFailedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "retryable-writes-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "no-writes-performed-collection" | ||
} | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "InsertOne fails after NoWritesPerformed error", | ||
"operations": [ | ||
{ | ||
"name": "failPoint", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "client0", | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 2 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"insert" | ||
], | ||
"errorCode": 64, | ||
"errorLabels": [ | ||
"NoWritesPerformed", | ||
"RetryableWriteError" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "insertOne", | ||
"object": "collection0", | ||
"arguments": { | ||
"document": { | ||
"x": 1 | ||
} | ||
}, | ||
"expectError": { | ||
"errorCode": 64, | ||
"errorLabelsContain": [ | ||
"NoWritesPerformed", | ||
"RetryableWriteError" | ||
] | ||
} | ||
} | ||
], | ||
"outcome": [ | ||
{ | ||
"collectionName": "no-writes-performed-collection", | ||
"databaseName": "retryable-writes-tests", | ||
"documents": [] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, this "goto" is defensive. One of the conditions for setting the "prevIndefiniteError" is that it is not the same type of error as the one that is the subject of this switch condition: "tt". If that is the case, we need to repeat the switch block for the "previousIndefiniteError" so that it can run the logic for the correct case.
If the "previousIndefiniteError" is the same as "tt", then there is no need to entire this block and the error can continue with its processing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. It makes sense.