Repository navigation
RUBY-3986 Mandate raising writeConcernError (change SHOULD to MUST) #3125
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
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
66 changes: 66 additions & 0 deletions
66
spec/spec_tests/data/read_write_concern/write_concern_errors/aggregate.yml
This file contains hidden or 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,66 @@ | ||
| description: write-concern-errors-aggregate | ||
|
|
||
| schemaVersion: "1.0" | ||
|
|
||
| createEntities: | ||
| - client: | ||
| id: &client0 client0 | ||
| useMultipleMongoses: false | ||
| - database: | ||
| id: &database0 database0 | ||
| client: *client0 | ||
| databaseName: &database_name write-concern-errors-tests | ||
| - collection: | ||
| id: &collection0 collection0 | ||
| database: *database0 | ||
| collectionName: &collection_name coll | ||
|
|
||
| # Create the database used for aggregate to avoid a NamespaceNotFound error. | ||
| initialData: | ||
| - collectionName: *collection_name | ||
| databaseName: *database_name | ||
| documents: [] | ||
|
|
||
| tests: | ||
| - description: aggregate with $out reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ aggregate ] | ||
| writeConcernError: &write_concern_error | ||
| code: 79 | ||
| codeName: UnknownReplWriteConcern | ||
| - name: aggregate | ||
| object: *collection0 | ||
| arguments: | ||
| pipeline: | ||
| - $match: { _id: { $gt: 1 } } | ||
| - $out: "aggregate_out" | ||
| expectError: &expect_write_concern_error | ||
| errorCode: 79 | ||
|
|
||
| - description: aggregate with $merge reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ aggregate ] | ||
| writeConcernError: *write_concern_error | ||
| - name: aggregate | ||
| object: *collection0 | ||
| arguments: | ||
| pipeline: | ||
| - $match: { _id: { $gt: 1 } } | ||
| - $merge: { into: "aggregate_merge" } | ||
| expectError: *expect_write_concern_error |
40 changes: 40 additions & 0 deletions
40
spec/spec_tests/data/read_write_concern/write_concern_errors/bulkWrite.yml
This file contains hidden or 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,40 @@ | ||
| description: write-concern-errors-bulkWrite | ||
|
|
||
| schemaVersion: "1.0" | ||
|
|
||
| createEntities: | ||
| - client: | ||
| id: &client0 client0 | ||
| useMultipleMongoses: false | ||
| - database: | ||
| id: &database0 database0 | ||
| client: *client0 | ||
| databaseName: write-concern-errors-tests | ||
| - collection: | ||
| id: &collection0 collection0 | ||
| database: *database0 | ||
| collectionName: coll | ||
|
|
||
| tests: | ||
| - description: bulkWrite reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ insert ] | ||
| writeConcernError: | ||
| code: 79 | ||
| codeName: UnknownReplWriteConcern | ||
| - name: bulkWrite | ||
| object: *collection0 | ||
| arguments: | ||
| requests: | ||
| - insertOne: | ||
| document: { x: 33 } | ||
| expectError: | ||
| isError: true |
37 changes: 37 additions & 0 deletions
37
spec/spec_tests/data/read_write_concern/write_concern_errors/client-bulkWrite.yml
This file contains hidden or 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,37 @@ | ||
| description: write-concern-errors-client-bulkWrite | ||
|
|
||
| schemaVersion: "1.21" | ||
|
|
||
| runOnRequirements: | ||
| - minServerVersion: "8.0" | ||
|
|
||
| createEntities: | ||
| - client: | ||
| id: &client0 client0 | ||
| useMultipleMongoses: false | ||
|
|
||
| tests: | ||
| - description: clientBulkWrite reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ bulkWrite ] | ||
| writeConcernError: | ||
| code: 79 | ||
| codeName: UnknownReplWriteConcern | ||
| - name: clientBulkWrite | ||
| object: *client0 | ||
| arguments: | ||
| models: | ||
| - insertOne: | ||
| namespace: write-concern-errors-tests.coll | ||
| document: { x: 33 } | ||
| expectError: | ||
| writeConcernErrors: | ||
| - code: 79 |
129 changes: 129 additions & 0 deletions
129
spec/spec_tests/data/read_write_concern/write_concern_errors/client-side-encryption.yml
This file contains hidden or 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,129 @@ | ||
| description: write-concern-errors-client-side-encryption | ||
|
|
||
| schemaVersion: "1.8" | ||
|
|
||
| runOnRequirements: | ||
| - csfle: true | ||
|
|
||
| createEntities: | ||
| - client: | ||
| id: &client0 client0 | ||
| useMultipleMongoses: false | ||
| - clientEncryption: | ||
| id: &clientEncryption0 clientEncryption0 | ||
| clientEncryptionOpts: | ||
| keyVaultClient: *client0 | ||
| keyVaultNamespace: keyvault.datakeys | ||
| kmsProviders: | ||
| local: { key: { $$placeholder: 1 } } | ||
|
|
||
| initialData: | ||
| - databaseName: keyvault | ||
| collectionName: datakeys | ||
| documents: | ||
| - _id: { $binary: { base64: bG9jYWxrZXlsb2NhbGtleQ==, subType: "04" } } | ||
| keyAltNames: ["local_key"] | ||
| keyMaterial: | ||
| { | ||
| $binary: | ||
| { | ||
| base64: ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==, | ||
| subType: "00", | ||
| }, | ||
| } | ||
| creationDate: { $date: { $numberLong: "1641024000000" } } | ||
| updateDate: { $date: { $numberLong: "1641024000000" } } | ||
| status: 1 | ||
| masterKey: | ||
| provider: local | ||
|
|
||
| tests: | ||
| - description: rewrapManyDataKey reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ update ] | ||
| writeConcernError: &write_concern_error | ||
| code: 79 | ||
| codeName: UnknownReplWriteConcern | ||
| - name: rewrapManyDataKey | ||
| object: *clientEncryption0 | ||
| arguments: | ||
| filter: {} | ||
| opts: | ||
| provider: local | ||
| expectError: | ||
| isError: true | ||
|
|
||
| - description: createDataKey reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ insert ] | ||
| writeConcernError: *write_concern_error | ||
| - name: createDataKey | ||
| object: *clientEncryption0 | ||
| arguments: | ||
| kmsProvider: local | ||
| expectError: &expect_write_concern_error | ||
| errorCode: 79 | ||
|
|
||
| - description: deleteKey reports a writeConcernError | ||
| operations: | ||
| - name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ delete ] | ||
| writeConcernError: *write_concern_error | ||
| - name: deleteKey | ||
| object: *clientEncryption0 | ||
| arguments: | ||
| id: &local_key_id { $binary: { base64: bG9jYWxrZXlsb2NhbGtleQ==, subType: "04" } } | ||
| expectError: *expect_write_concern_error | ||
|
|
||
| - description: addKeyAltName reports a writeConcernError | ||
| operations: | ||
| - &failPoint_findAndModify | ||
| name: failPoint | ||
| object: testRunner | ||
| arguments: | ||
| client: *client0 | ||
| failPoint: | ||
| configureFailPoint: failCommand | ||
| mode: { times: 1 } | ||
| data: | ||
| failCommands: [ findAndModify ] | ||
| writeConcernError: *write_concern_error | ||
| - name: addKeyAltName | ||
| object: *clientEncryption0 | ||
| arguments: | ||
| id: *local_key_id | ||
| keyAltName: new_key_alt_name | ||
| expectError: *expect_write_concern_error | ||
|
|
||
| - description: removeKeyAltName reports a writeConcernError | ||
| operations: | ||
| - *failPoint_findAndModify | ||
| - name: removeKeyAltName | ||
| object: *clientEncryption0 | ||
| arguments: | ||
| id: *local_key_id | ||
| keyAltName: local_key | ||
| expectError: *expect_write_concern_error |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.