From 25a41968d027a1a5cb9aa0d0c9509308717059b2 Mon Sep 17 00:00:00 2001 From: Aditi Khare Date: Tue, 9 Jul 2024 14:34:33 -0400 Subject: [PATCH] skip clientBulkWrite tests and remove duplicate folder --- .../retryable_writes.spec.test.ts | 20 +- test/spec/unified/bulkWrite-errorLabels.json | 416 ---- test/spec/unified/bulkWrite-errorLabels.yml | 222 -- test/spec/unified/bulkWrite-serverErrors.json | 285 --- test/spec/unified/bulkWrite-serverErrors.yml | 136 -- test/spec/unified/bulkWrite.json | 931 -------- test/spec/unified/bulkWrite.yml | 495 ---- .../client-bulkWrite-clientErrors.json | 350 --- .../unified/client-bulkWrite-clientErrors.yml | 172 -- .../client-bulkWrite-serverErrors.json | 872 ------- .../unified/client-bulkWrite-serverErrors.yml | 412 ---- test/spec/unified/deleteMany.json | 76 - test/spec/unified/deleteMany.yml | 49 - test/spec/unified/deleteOne-errorLabels.json | 266 --- test/spec/unified/deleteOne-errorLabels.yml | 157 -- test/spec/unified/deleteOne-serverErrors.json | 114 - test/spec/unified/deleteOne-serverErrors.yml | 67 - test/spec/unified/deleteOne.json | 188 -- test/spec/unified/deleteOne.yml | 111 - .../unified/findOneAndDelete-errorLabels.json | 289 --- .../unified/findOneAndDelete-errorLabels.yml | 158 -- .../findOneAndDelete-serverErrors.json | 119 - .../unified/findOneAndDelete-serverErrors.yml | 68 - test/spec/unified/findOneAndDelete.json | 205 -- test/spec/unified/findOneAndDelete.yml | 112 - .../findOneAndReplace-errorLabels.json | 301 --- .../unified/findOneAndReplace-errorLabels.yml | 165 -- .../findOneAndReplace-serverErrors.json | 119 - .../findOneAndReplace-serverErrors.yml | 69 - test/spec/unified/findOneAndReplace.json | 213 -- test/spec/unified/findOneAndReplace.yml | 117 - .../unified/findOneAndUpdate-errorLabels.json | 305 --- .../unified/findOneAndUpdate-errorLabels.yml | 165 -- .../findOneAndUpdate-serverErrors.json | 120 - .../unified/findOneAndUpdate-serverErrors.yml | 69 - test/spec/unified/findOneAndUpdate.json | 215 -- test/spec/unified/findOneAndUpdate.yml | 116 - test/spec/unified/handshakeError.json | 2013 ----------------- test/spec/unified/handshakeError.yml | 875 ------- test/spec/unified/insertMany-errorLabels.json | 335 --- test/spec/unified/insertMany-errorLabels.yml | 185 -- .../spec/unified/insertMany-serverErrors.json | 114 - test/spec/unified/insertMany-serverErrors.yml | 68 - test/spec/unified/insertMany.json | 233 -- test/spec/unified/insertMany.yml | 135 -- test/spec/unified/insertOne-errorLabels.json | 1127 --------- test/spec/unified/insertOne-errorLabels.yml | 610 ----- .../insertOne-noWritesPerformedError.json | 90 - .../insertOne-noWritesPerformedError.yml | 51 - test/spec/unified/insertOne-serverErrors.json | 865 ------- test/spec/unified/insertOne-serverErrors.yml | 406 ---- test/spec/unified/insertOne.json | 215 -- test/spec/unified/insertOne.yml | 115 - test/spec/unified/replaceOne-errorLabels.json | 300 --- test/spec/unified/replaceOne-errorLabels.yml | 170 -- .../spec/unified/replaceOne-serverErrors.json | 118 - test/spec/unified/replaceOne-serverErrors.yml | 68 - test/spec/unified/replaceOne.json | 212 -- test/spec/unified/replaceOne.yml | 120 - test/spec/unified/updateMany.json | 92 - test/spec/unified/updateMany.yml | 54 - test/spec/unified/updateOne-errorLabels.json | 304 --- test/spec/unified/updateOne-errorLabels.yml | 170 -- test/spec/unified/updateOne-serverErrors.json | 119 - test/spec/unified/updateOne-serverErrors.yml | 71 - test/spec/unified/updateOne.json | 394 ---- test/spec/unified/updateOne.yml | 213 -- 67 files changed, 19 insertions(+), 18087 deletions(-) delete mode 100644 test/spec/unified/bulkWrite-errorLabels.json delete mode 100644 test/spec/unified/bulkWrite-errorLabels.yml delete mode 100644 test/spec/unified/bulkWrite-serverErrors.json delete mode 100644 test/spec/unified/bulkWrite-serverErrors.yml delete mode 100644 test/spec/unified/bulkWrite.json delete mode 100644 test/spec/unified/bulkWrite.yml delete mode 100644 test/spec/unified/client-bulkWrite-clientErrors.json delete mode 100644 test/spec/unified/client-bulkWrite-clientErrors.yml delete mode 100644 test/spec/unified/client-bulkWrite-serverErrors.json delete mode 100644 test/spec/unified/client-bulkWrite-serverErrors.yml delete mode 100644 test/spec/unified/deleteMany.json delete mode 100644 test/spec/unified/deleteMany.yml delete mode 100644 test/spec/unified/deleteOne-errorLabels.json delete mode 100644 test/spec/unified/deleteOne-errorLabels.yml delete mode 100644 test/spec/unified/deleteOne-serverErrors.json delete mode 100644 test/spec/unified/deleteOne-serverErrors.yml delete mode 100644 test/spec/unified/deleteOne.json delete mode 100644 test/spec/unified/deleteOne.yml delete mode 100644 test/spec/unified/findOneAndDelete-errorLabels.json delete mode 100644 test/spec/unified/findOneAndDelete-errorLabels.yml delete mode 100644 test/spec/unified/findOneAndDelete-serverErrors.json delete mode 100644 test/spec/unified/findOneAndDelete-serverErrors.yml delete mode 100644 test/spec/unified/findOneAndDelete.json delete mode 100644 test/spec/unified/findOneAndDelete.yml delete mode 100644 test/spec/unified/findOneAndReplace-errorLabels.json delete mode 100644 test/spec/unified/findOneAndReplace-errorLabels.yml delete mode 100644 test/spec/unified/findOneAndReplace-serverErrors.json delete mode 100644 test/spec/unified/findOneAndReplace-serverErrors.yml delete mode 100644 test/spec/unified/findOneAndReplace.json delete mode 100644 test/spec/unified/findOneAndReplace.yml delete mode 100644 test/spec/unified/findOneAndUpdate-errorLabels.json delete mode 100644 test/spec/unified/findOneAndUpdate-errorLabels.yml delete mode 100644 test/spec/unified/findOneAndUpdate-serverErrors.json delete mode 100644 test/spec/unified/findOneAndUpdate-serverErrors.yml delete mode 100644 test/spec/unified/findOneAndUpdate.json delete mode 100644 test/spec/unified/findOneAndUpdate.yml delete mode 100644 test/spec/unified/handshakeError.json delete mode 100644 test/spec/unified/handshakeError.yml delete mode 100644 test/spec/unified/insertMany-errorLabels.json delete mode 100644 test/spec/unified/insertMany-errorLabels.yml delete mode 100644 test/spec/unified/insertMany-serverErrors.json delete mode 100644 test/spec/unified/insertMany-serverErrors.yml delete mode 100644 test/spec/unified/insertMany.json delete mode 100644 test/spec/unified/insertMany.yml delete mode 100644 test/spec/unified/insertOne-errorLabels.json delete mode 100644 test/spec/unified/insertOne-errorLabels.yml delete mode 100644 test/spec/unified/insertOne-noWritesPerformedError.json delete mode 100644 test/spec/unified/insertOne-noWritesPerformedError.yml delete mode 100644 test/spec/unified/insertOne-serverErrors.json delete mode 100644 test/spec/unified/insertOne-serverErrors.yml delete mode 100644 test/spec/unified/insertOne.json delete mode 100644 test/spec/unified/insertOne.yml delete mode 100644 test/spec/unified/replaceOne-errorLabels.json delete mode 100644 test/spec/unified/replaceOne-errorLabels.yml delete mode 100644 test/spec/unified/replaceOne-serverErrors.json delete mode 100644 test/spec/unified/replaceOne-serverErrors.yml delete mode 100644 test/spec/unified/replaceOne.json delete mode 100644 test/spec/unified/replaceOne.yml delete mode 100644 test/spec/unified/updateMany.json delete mode 100644 test/spec/unified/updateMany.yml delete mode 100644 test/spec/unified/updateOne-errorLabels.json delete mode 100644 test/spec/unified/updateOne-errorLabels.yml delete mode 100644 test/spec/unified/updateOne-serverErrors.json delete mode 100644 test/spec/unified/updateOne-serverErrors.yml delete mode 100644 test/spec/unified/updateOne.json delete mode 100644 test/spec/unified/updateOne.yml diff --git a/test/integration/retryable-writes/retryable_writes.spec.test.ts b/test/integration/retryable-writes/retryable_writes.spec.test.ts index f34ef3bff51..04927730e06 100644 --- a/test/integration/retryable-writes/retryable_writes.spec.test.ts +++ b/test/integration/retryable-writes/retryable_writes.spec.test.ts @@ -1,6 +1,24 @@ import { loadSpecTests } from '../../spec'; import { runUnifiedSuite } from '../../tools/unified-spec-runner/runner'; +const CLIENT_BULK_WRITE_TESTS = [ + 'client bulkWrite with one network error succeeds after retry', + 'client bulkWrite with two network errors fails after retry', + 'client bulkWrite with no multi: true operations succeeds after retryable top-level error', + 'client bulkWrite with multi: true operations fails after retryable top-level error', + 'client bulkWrite with no multi: true operations succeeds after retryable writeConcernError', + 'client bulkWrite with multi: true operations fails after retryable writeConcernError', + 'client bulkWrite with retryWrites: false does not retry', + 'client.clientBulkWrite succeeds after retryable handshake network error', + 'client.clientBulkWrite succeeds after retryable handshake server error (ShutdownInProgress)' +]; + describe('Retryable Writes', function () { - runUnifiedSuite(loadSpecTests('retryable-writes')); + const tests = loadSpecTests('retryable-writes'); + runUnifiedSuite(tests, test => { + if (CLIENT_BULK_WRITE_TESTS.includes(test.description)) { + return 'TODO(NODE-6257): unskip this once clientBulkWrite UTR entity is supported'; + } + return false; + }); }); diff --git a/test/spec/unified/bulkWrite-errorLabels.json b/test/spec/unified/bulkWrite-errorLabels.json deleted file mode 100644 index 13ba9bae757..00000000000 --- a/test/spec/unified/bulkWrite-errorLabels.json +++ /dev/null @@ -1,416 +0,0 @@ -{ - "description": "bulkWrite-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 3 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 3 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 3 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/bulkWrite-errorLabels.yml b/test/spec/unified/bulkWrite-errorLabels.yml deleted file mode 100644 index 9adec6de718..00000000000 --- a/test/spec/unified/bulkWrite-errorLabels.yml +++ /dev/null @@ -1,222 +0,0 @@ -description: bulkWrite-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'BulkWrite succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteOne: - filter: { _id: 1 } - - - insertOne: - document: { _id: 3, x: 33 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - # Driver retries operation and it succeeds - expectResult: - deletedCount: 1 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '1': 3 } } - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 23 } - - { _id: 3, x: 33 } - - - description: 'BulkWrite fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteOne: - filter: { _id: 1 } - - - insertOne: - document: { _id: 3, x: 33 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'BulkWrite succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteOne: - filter: { _id: 1 } - - - insertOne: - document: { _id: 3, x: 33 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - expectResult: - deletedCount: 1 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '1': 3 } } - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 23 } - - { _id: 3, x: 33 } - - - description: 'BulkWrite succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteOne: - filter: { _id: 1 } - - - insertOne: - document: { _id: 3, x: 33 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - expectResult: - deletedCount: 1 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '1': 3 } } - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 23 } - - { _id: 3, x: 33 } diff --git a/test/spec/unified/bulkWrite-serverErrors.json b/test/spec/unified/bulkWrite-serverErrors.json deleted file mode 100644 index 0a063ab4d99..00000000000 --- a/test/spec/unified/bulkWrite-serverErrors.json +++ /dev/null @@ -1,285 +0,0 @@ -{ - "description": "retryable-writes bulkWrite serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite succeeds after retryable writeConcernError in first batch", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - } - } - } - ] - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": { - "0": 3 - } - }, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": { - "_id": 2 - }, - "limit": 1 - } - ] - }, - "commandName": "delete", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/bulkWrite-serverErrors.yml b/test/spec/unified/bulkWrite-serverErrors.yml deleted file mode 100644 index a88a2061231..00000000000 --- a/test/spec/unified/bulkWrite-serverErrors.yml +++ /dev/null @@ -1,136 +0,0 @@ -description: "retryable-writes bulkWrite serverErrors" - -schemaVersion: "1.3" - -runOnRequirements: - - minServerVersion: "4.0" - topologies: [ replicaset ] - - minServerVersion: "4.1.7" - topologies: [ sharded, load-balanced ] - -createEntities: - - client: - id: &client0 client0 - useMultipleMongoses: false - observeEvents: [ commandStartedEvent ] - - database: - id: &database0 database0 - client: *client0 - databaseName: &databaseName retryable-writes-tests - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collectionName coll - -initialData: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - description: "BulkWrite succeeds after retryable writeConcernError in first batch" - runOnRequirements: - - minServerVersion: "4.3.1" # failCommand errorLabels option - operations: - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: [RetryableWriteError] # top-level error labels - writeConcernError: - code: 91 # ShutdownInProgress - errmsg: "Replication is being shut down" - - name: bulkWrite - object: *collection0 - arguments: - requests: - - insertOne: - document: { _id: 3, x: 33 } - - deleteOne: - filter: { _id: 2 } - expectResult: - deletedCount: 1 - insertedCount: 1 - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 0 - insertedIds: { $$unsetOrMatches: { 0: 3 } } - upsertedIds: { } - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - command: - insert: *collectionName - documents: [{ _id: 3, x: 33 }] - commandName: insert - databaseName: *databaseName - - commandStartedEvent: - command: - insert: *collectionName - documents: [{ _id: 3, x: 33 }] - commandName: insert - databaseName: *databaseName - - commandStartedEvent: - command: - delete: *collectionName - deletes: - - - q: { _id: 2 } - limit: 1 - commandName: delete - databaseName: *databaseName - outcome: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 3, x: 33 } # The write was still applied - - - description: 'BulkWrite fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ update ] - closeConnection: true - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteOne: - filter: { _id: 1 } - - - insertOne: - document: { _id: 3, x: 33 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } diff --git a/test/spec/unified/bulkWrite.json b/test/spec/unified/bulkWrite.json deleted file mode 100644 index 691321746b2..00000000000 --- a/test/spec/unified/bulkWrite.json +++ /dev/null @@ -1,931 +0,0 @@ -{ - "description": "bulkWrite", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "First command is retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "All commands are retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 7 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 4, - "x": 44 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - }, - { - "insertOne": { - "document": { - "_id": 5, - "x": 55 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "_id": 3, - "x": 333 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 3, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "2": 3, - "4": 5 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 1, - "upsertedIds": { - "3": 4 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 333 - }, - { - "_id": 4, - "x": 45 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ] - }, - { - "description": "Both commands are retried after their first statement fails", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "Second command is retried after its second statement fails", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "skip": 2 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "BulkWrite with unordered execution", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "ordered": false - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "First insertOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "Second updateOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "skip": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "Third updateOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "skip": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 2 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "Single-document write following deleteMany is retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "x": 11 - } - } - }, - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 2 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "Single-document write following updateMany is retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "x": 11 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 2 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/bulkWrite.yml b/test/spec/unified/bulkWrite.yml deleted file mode 100644 index d064c9dbc52..00000000000 --- a/test/spec/unified/bulkWrite.yml +++ /dev/null @@ -1,495 +0,0 @@ -description: bulkWrite - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - -tests: - - - description: 'First command is retried' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - - - deleteOne: - filter: { _id: 1 } - ordered: true - expectResult: - deletedCount: 1 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '0': 2 } } - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 23 } - - - # Write operations in this ordered batch are intentionally sequenced so that - # each write command consists of a single statement, which will fail on the - # first attempt and succeed on the second, retry attempt. - description: 'All commands are retried' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 7 } - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - - - insertOne: - document: { _id: 3, x: 33 } - - - updateOne: - filter: { _id: 4, x: 44 } - update: { $inc: { x: 1 } } - upsert: true - - - insertOne: - document: { _id: 5, x: 55 } - - - replaceOne: - filter: { _id: 3 } - replacement: { _id: 3, x: 333 } - - - deleteOne: - filter: { _id: 1 } - ordered: true - expectResult: - deletedCount: 1 - insertedCount: 3 - insertedIds: - $$unsetOrMatches: - '0': 2 - '2': 3 - '4': 5 - matchedCount: 2 - modifiedCount: 2 - upsertedCount: 1 - upsertedIds: { '3': 4 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 23 } - - { _id: 3, x: 333 } - - { _id: 4, x: 45 } - - { _id: 5, x: 55 } - - - description: 'Both commands are retried after their first statement fails' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - expectResult: - deletedCount: 0 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '0': 2 } } - matchedCount: 2 - modifiedCount: 2 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 23 } - - - description: 'Second command is retried after its second statement fails' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { skip: 2 } - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - expectResult: - deletedCount: 0 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '0': 2 } } - matchedCount: 2 - modifiedCount: 2 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 23 } - - - description: 'BulkWrite with unordered execution' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - insertOne: - document: { _id: 3, x: 33 } - ordered: false - expectResult: - deletedCount: 0 - insertedCount: 2 - insertedIds: - $$unsetOrMatches: - '0': 2 - '1': 3 - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'First insertOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - - - deleteOne: - filter: { _id: 1 } - ordered: true - expectError: - isError: true - expectResult: - deletedCount: 0 - insertedCount: 0 - insertedIds: - $$unsetOrMatches: { } - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'Second updateOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { skip: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - - - deleteOne: - filter: { _id: 1 } - ordered: true - expectError: - isError: true - expectResult: - deletedCount: 0 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '0': 2 } } - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'Third updateOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { skip: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateOne: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - - - insertOne: - document: { _id: 2, x: 22 } - - - updateOne: - filter: { _id: 2 } - update: { $inc: { x: 1 } } - ordered: true - expectError: - isError: true - expectResult: - deletedCount: 0 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '1': 2 } } - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - # The onPrimaryTransactionalWrite fail point only triggers for write - # operations that include a transaction ID. Therefore, it will not affect - # the initial deleteMany and will trigger once (and only once) for the first - # insertOne attempt. - description: 'Single-document write following deleteMany is retried' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteMany: - filter: { x: 11 } - - - insertOne: - document: { _id: 2, x: 22 } - ordered: true - expectResult: - deletedCount: 1 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '1': 2 } } - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - # The onPrimaryTransactionalWrite fail point only triggers for write - # operations that include a transaction ID. Therefore, it will not affect - # the initial updateMany and will trigger once (and only once) for the first - # insertOne attempt. - description: 'Single-document write following updateMany is retried' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateMany: - filter: { x: 11 } - update: { $inc: { x: 1 } } - - - insertOne: - document: { _id: 2, x: 22 } - ordered: true - expectResult: - deletedCount: 0 - insertedCount: 1 - insertedIds: { $$unsetOrMatches: { '1': 2 } } - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - upsertedIds: { } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/client-bulkWrite-clientErrors.json b/test/spec/unified/client-bulkWrite-clientErrors.json deleted file mode 100644 index e2c0fb9c0a5..00000000000 --- a/test/spec/unified/client-bulkWrite-clientErrors.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "description": "client bulkWrite retryable writes with client errors", - "schemaVersion": "1.21", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "retryable-writes-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite with one network error succeeds after retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 4 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "client bulkWrite with two network errors fails after retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "verboseResults": true - }, - "expectError": { - "isClientError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/client-bulkWrite-clientErrors.yml b/test/spec/unified/client-bulkWrite-clientErrors.yml deleted file mode 100644 index 85696e89db2..00000000000 --- a/test/spec/unified/client-bulkWrite-clientErrors.yml +++ /dev/null @@ -1,172 +0,0 @@ -description: "client bulkWrite retryable writes with client errors" -schemaVersion: "1.21" -runOnRequirements: - - minServerVersion: "8.0" - topologies: - - replicaset - - sharded - - load-balanced - -createEntities: - - client: - id: &client0 client0 - observeEvents: [ commandStartedEvent ] - useMultipleMongoses: false - - database: - id: &database0 database0 - client: *client0 - databaseName: &database0Name retryable-writes-tests - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection0Name coll0 - -initialData: - - collectionName: *collection0Name - databaseName: *database0Name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - -_yamlAnchors: - namespace: &namespace "retryable-writes-tests.coll0" - -tests: - - description: "client bulkWrite with one network error succeeds after retry" - operations: - - object: testRunner - name: failPoint - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: - times: 1 - data: - failCommands: [ bulkWrite ] - closeConnection: true - - object: *client0 - name: clientBulkWrite - arguments: - models: - - insertOne: - namespace: *namespace - document: { _id: 4, x: 44 } - verboseResults: true - expectResult: - insertedCount: 1 - upsertedCount: 0 - matchedCount: 0 - modifiedCount: 0 - deletedCount: 0 - insertResults: - 0: - insertedId: 4 - updateResults: {} - deleteResults: {} - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - nsInfo: - - ns: *namespace - # An implicit session is included with the transaction number: - lsid: { "$$exists": true } - txnNumber: { "$$exists": true } - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - nsInfo: - - ns: *namespace - # An implicit session is included with the transaction number: - lsid: { "$$exists": true } - txnNumber: { "$$exists": true } - outcome: - - collectionName: *collection0Name - databaseName: *database0Name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - { _id: 4, x: 44 } - - description: "client bulkWrite with two network errors fails after retry" - operations: - - object: testRunner - name: failPoint - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: - times: 2 - data: - failCommands: [ bulkWrite ] - closeConnection: true - - object: *client0 - name: clientBulkWrite - arguments: - models: - - insertOne: - namespace: *namespace - document: { _id: 4, x: 44 } - verboseResults: true - expectError: - isClientError: true - errorLabelsContain: ["RetryableWriteError"] # Error label added by driver. - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - nsInfo: - - ns: *namespace - # An implicit session is included with the transaction number: - lsid: { "$$exists": true } - txnNumber: { "$$exists": true } - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - nsInfo: - - ns: *namespace - # An implicit session is included with the transaction number: - lsid: { "$$exists": true } - txnNumber: { "$$exists": true } - outcome: - - collectionName: *collection0Name - databaseName: *database0Name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } diff --git a/test/spec/unified/client-bulkWrite-serverErrors.json b/test/spec/unified/client-bulkWrite-serverErrors.json deleted file mode 100644 index 4a0b210eb59..00000000000 --- a/test/spec/unified/client-bulkWrite-serverErrors.json +++ /dev/null @@ -1,872 +0,0 @@ -{ - "description": "client bulkWrite retryable writes", - "schemaVersion": "1.21", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "clientRetryWritesFalse", - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "retryable-writes-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite with no multi: true operations succeeds after retryable top-level error", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "updateOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "replaceOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 2 - }, - "replacement": { - "x": 222 - } - } - }, - { - "deleteOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 2, - "modifiedCount": 2, - "deletedCount": 1, - "insertResults": { - "0": { - "insertedId": 4 - } - }, - "updateResults": { - "1": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": { - "3": { - "deletedCount": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 222 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "client bulkWrite with multi: true operations fails after retryable top-level error", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ] - }, - "expectError": { - "errorCode": 189, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": true - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ] - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite with no multi: true operations succeeds after retryable writeConcernError", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "updateOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "replaceOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 2 - }, - "replacement": { - "x": 222 - } - } - }, - { - "deleteOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 2, - "modifiedCount": 2, - "deletedCount": 1, - "insertResults": { - "0": { - "insertedId": 4 - } - }, - "updateResults": { - "1": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": { - "3": { - "deletedCount": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite with multi: true operations fails after retryable writeConcernError", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ] - }, - "expectError": { - "writeConcernErrors": [ - { - "code": 91, - "message": "Replication is being shut down" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": true - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ] - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite with retryWrites: false does not retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "clientRetryWritesFalse", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "clientRetryWritesFalse", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - } - ] - }, - "expectError": { - "errorCode": 189, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "clientRetryWritesFalse", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/client-bulkWrite-serverErrors.yml b/test/spec/unified/client-bulkWrite-serverErrors.yml deleted file mode 100644 index 23d2c622ee1..00000000000 --- a/test/spec/unified/client-bulkWrite-serverErrors.yml +++ /dev/null @@ -1,412 +0,0 @@ -description: "client bulkWrite retryable writes" -schemaVersion: "1.21" -runOnRequirements: - - minServerVersion: "8.0" - topologies: - - replicaset - - sharded - - load-balanced - -createEntities: - - client: - id: &client0 client0 - observeEvents: [ commandStartedEvent ] - useMultipleMongoses: false - - client: - id: &clientRetryWritesFalse clientRetryWritesFalse - uriOptions: - retryWrites: false - observeEvents: [ commandStartedEvent ] - useMultipleMongoses: false - - database: - id: &database0 database0 - client: *client0 - databaseName: &database0Name retryable-writes-tests - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection0Name coll0 - -initialData: - - collectionName: *collection0Name - databaseName: *database0Name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - -_yamlAnchors: - namespace: &namespace "retryable-writes-tests.coll0" - -tests: - - description: "client bulkWrite with no multi: true operations succeeds after retryable top-level error" - operations: - - object: testRunner - name: failPoint - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: - times: 1 - data: - failCommands: [ bulkWrite ] - errorCode: 189 # PrimarySteppedDown - errorLabels: [ RetryableWriteError ] - - object: *client0 - name: clientBulkWrite - arguments: - models: - - insertOne: - namespace: *namespace - document: { _id: 4, x: 44 } - - updateOne: - namespace: *namespace - filter: { _id: 1 } - update: - $inc: { x: 1 } - - replaceOne: - namespace: *namespace - filter: { _id: 2 } - replacement: { x: 222 } - - deleteOne: - namespace: *namespace - filter: { _id: 3 } - verboseResults: true - expectResult: - insertedCount: 1 - upsertedCount: 0 - matchedCount: 2 - modifiedCount: 2 - deletedCount: 1 - insertResults: - 0: - insertedId: 4 - updateResults: - 1: - matchedCount: 1 - modifiedCount: 1 - upsertedId: { $$exists: false } - 2: - matchedCount: 1 - modifiedCount: 1 - upsertedId: { $$exists: false } - deleteResults: - 3: - deletedCount: 1 - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - - update: 0 - filter: { _id: 1 } - updateMods: - $inc: { x: 1 } - multi: false - - update: 0 - filter: { _id: 2 } - updateMods: { x: 222 } - multi: false - - delete: 0 - filter: { _id: 3 } - multi: false - nsInfo: - - ns: *namespace - lsid: { $$exists: true } - txnNumber: { $$exists: true } - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - - update: 0 - filter: { _id: 1 } - updateMods: - $inc: { x: 1 } - multi: false - - update: 0 - filter: { _id: 2 } - updateMods: { x: 222 } - multi: false - - delete: 0 - filter: { _id: 3 } - multi: false - nsInfo: - - ns: *namespace - lsid: { $$exists: true } - txnNumber: { $$exists: true } - outcome: - - collectionName: *collection0Name - databaseName: *database0Name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 222 } - - { _id: 4, x: 44 } - - description: "client bulkWrite with multi: true operations fails after retryable top-level error" - operations: - - object: testRunner - name: failPoint - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: - times: 1 - data: - failCommands: [ bulkWrite ] - errorCode: 189 # PrimarySteppedDown - errorLabels: [ RetryableWriteError ] - - object: *client0 - name: clientBulkWrite - arguments: - models: - - updateMany: - namespace: *namespace - filter: { _id: 1 } - update: - $inc: { x: 1 } - - deleteMany: - namespace: *namespace - filter: { _id: 3 } - expectError: - errorCode: 189 - errorLabelsContain: [ RetryableWriteError ] - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: true - ordered: true - ops: - - update: 0 - filter: { _id: 1 } - updateMods: - $inc: { x: 1 } - multi: true - - delete: 0 - filter: { _id: 3 } - multi: true - nsInfo: - - ns: *namespace - - description: "client bulkWrite with no multi: true operations succeeds after retryable writeConcernError" - operations: - - object: testRunner - name: failPoint - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: - times: 1 - data: - failCommands: [ bulkWrite ] - errorLabels: [ RetryableWriteError ] - writeConcernError: - code: 91 - errmsg: "Replication is being shut down" - - object: *client0 - name: clientBulkWrite - arguments: - models: - - insertOne: - namespace: *namespace - document: { _id: 4, x: 44 } - - updateOne: - namespace: *namespace - filter: { _id: 1 } - update: - $inc: { x: 1 } - - replaceOne: - namespace: *namespace - filter: { _id: 2 } - replacement: { x: 222 } - - deleteOne: - namespace: *namespace - filter: { _id: 3 } - verboseResults: true - expectResult: - insertedCount: 1 - upsertedCount: 0 - matchedCount: 2 - modifiedCount: 2 - deletedCount: 1 - insertResults: - 0: - insertedId: 4 - updateResults: - 1: - matchedCount: 1 - modifiedCount: 1 - upsertedId: { $$exists: false } - 2: - matchedCount: 1 - modifiedCount: 1 - upsertedId: { $$exists: false } - deleteResults: - 3: - deletedCount: 1 - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - - update: 0 - filter: { _id: 1 } - updateMods: - $inc: { x: 1 } - multi: false - - update: 0 - filter: { _id: 2 } - updateMods: { x: 222 } - multi: false - - delete: 0 - filter: { _id: 3 } - multi: false - nsInfo: - - ns: *namespace - lsid: { $$exists: true } - txnNumber: { $$exists: true } - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: false - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - - update: 0 - filter: { _id: 1 } - updateMods: - $inc: { x: 1 } - multi: false - - update: 0 - filter: { _id: 2 } - updateMods: { x: 222 } - multi: false - - delete: 0 - filter: { _id: 3 } - multi: false - nsInfo: - - ns: *namespace - lsid: { $$exists: true } - txnNumber: { $$exists: true } - - description: "client bulkWrite with multi: true operations fails after retryable writeConcernError" - operations: - - object: testRunner - name: failPoint - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: - times: 1 - data: - failCommands: [ bulkWrite ] - errorLabels: [ RetryableWriteError ] - writeConcernError: - code: 91 - errmsg: "Replication is being shut down" - - object: *client0 - name: clientBulkWrite - arguments: - models: - - updateMany: - namespace: *namespace - filter: { _id: 1 } - update: - $inc: { x: 1 } - - deleteMany: - namespace: *namespace - filter: { _id: 3 } - expectError: - writeConcernErrors: - - code: 91 - message: "Replication is being shut down" - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: true - ordered: true - ops: - - update: 0 - filter: { _id: 1 } - updateMods: - $inc: { x: 1 } - multi: true - - delete: 0 - filter: { _id: 3 } - multi: true - nsInfo: - - ns: *namespace - - description: "client bulkWrite with retryWrites: false does not retry" - operations: - - object: testRunner - name: failPoint - arguments: - client: *clientRetryWritesFalse - failPoint: - configureFailPoint: failCommand - mode: - times: 1 - data: - failCommands: [ bulkWrite ] - errorCode: 189 # PrimarySteppedDown - errorLabels: [ RetryableWriteError ] - - object: *clientRetryWritesFalse - name: clientBulkWrite - arguments: - models: - - insertOne: - namespace: *namespace - document: { _id: 4, x: 44 } - expectError: - errorCode: 189 - errorLabelsContain: [ RetryableWriteError ] - expectEvents: - - client: *clientRetryWritesFalse - events: - - commandStartedEvent: - commandName: bulkWrite - databaseName: admin - command: - bulkWrite: 1 - errorsOnly: true - ordered: true - ops: - - insert: 0 - document: { _id: 4, x: 44 } - nsInfo: - - ns: *namespace diff --git a/test/spec/unified/deleteMany.json b/test/spec/unified/deleteMany.json deleted file mode 100644 index 087576cc0f6..00000000000 --- a/test/spec/unified/deleteMany.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "description": "deleteMany", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany ignores retryWrites", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": {} - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ] - } - ] -} diff --git a/test/spec/unified/deleteMany.yml b/test/spec/unified/deleteMany.yml deleted file mode 100644 index 31a6e07864e..00000000000 --- a/test/spec/unified/deleteMany.yml +++ /dev/null @@ -1,49 +0,0 @@ -description: deleteMany - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: true - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'DeleteMany ignores retryWrites' - operations: - - - object: *collection0 - name: deleteMany - arguments: - filter: { } - expectResult: - deletedCount: 2 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: [] diff --git a/test/spec/unified/deleteOne-errorLabels.json b/test/spec/unified/deleteOne-errorLabels.json deleted file mode 100644 index 88920862ec5..00000000000 --- a/test/spec/unified/deleteOne-errorLabels.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "description": "deleteOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/deleteOne-errorLabels.yml b/test/spec/unified/deleteOne-errorLabels.yml deleted file mode 100644 index 08e700a9bb2..00000000000 --- a/test/spec/unified/deleteOne-errorLabels.yml +++ /dev/null @@ -1,157 +0,0 @@ -description: deleteOne-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'DeleteOne succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ delete ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - # Driver retries operation and it succeeds - expectResult: - deletedCount: 1 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'DeleteOne fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ delete ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'DeleteOne succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ delete ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - expectResult: - deletedCount: 1 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'DeleteOne succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ delete ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - expectResult: - deletedCount: 1 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } diff --git a/test/spec/unified/deleteOne-serverErrors.json b/test/spec/unified/deleteOne-serverErrors.json deleted file mode 100644 index 0808b7921de..00000000000 --- a/test/spec/unified/deleteOne-serverErrors.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "description": "deleteOne-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne fails with RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/deleteOne-serverErrors.yml b/test/spec/unified/deleteOne-serverErrors.yml deleted file mode 100644 index 2b63c43e37c..00000000000 --- a/test/spec/unified/deleteOne-serverErrors.yml +++ /dev/null @@ -1,67 +0,0 @@ -description: deleteOne-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'DeleteOne fails with RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ delete ] - closeConnection: true - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/deleteOne.json b/test/spec/unified/deleteOne.json deleted file mode 100644 index c3aaf886555..00000000000 --- a/test/spec/unified/deleteOne.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "description": "deleteOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/deleteOne.yml b/test/spec/unified/deleteOne.yml deleted file mode 100644 index ee31a33248d..00000000000 --- a/test/spec/unified/deleteOne.yml +++ /dev/null @@ -1,111 +0,0 @@ -description: deleteOne - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'DeleteOne is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - expectResult: - deletedCount: 1 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'DeleteOne is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - expectResult: - deletedCount: 1 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'DeleteOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: deleteOne - arguments: - filter: { _id: 1 } - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndDelete-errorLabels.json b/test/spec/unified/findOneAndDelete-errorLabels.json deleted file mode 100644 index 8639873fca0..00000000000 --- a/test/spec/unified/findOneAndDelete-errorLabels.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "description": "findOneAndDelete-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndDelete-errorLabels.yml b/test/spec/unified/findOneAndDelete-errorLabels.yml deleted file mode 100644 index cd712f2eb32..00000000000 --- a/test/spec/unified/findOneAndDelete-errorLabels.yml +++ /dev/null @@ -1,158 +0,0 @@ -description: findOneAndDelete-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndDelete succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - # Driver retries operation and it succeeds - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'FindOneAndDelete fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndDelete succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'FindOneAndDelete succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndDelete-serverErrors.json b/test/spec/unified/findOneAndDelete-serverErrors.json deleted file mode 100644 index f6d8e9d69c7..00000000000 --- a/test/spec/unified/findOneAndDelete-serverErrors.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "findOneAndDelete-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndDelete-serverErrors.yml b/test/spec/unified/findOneAndDelete-serverErrors.yml deleted file mode 100644 index a9da496c081..00000000000 --- a/test/spec/unified/findOneAndDelete-serverErrors.yml +++ /dev/null @@ -1,68 +0,0 @@ -description: findOneAndDelete-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndDelete fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ findAndModify ] - closeConnection: true - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndDelete.json b/test/spec/unified/findOneAndDelete.json deleted file mode 100644 index 89dbb9d6551..00000000000 --- a/test/spec/unified/findOneAndDelete.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "description": "findOneAndDelete", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndDelete.yml b/test/spec/unified/findOneAndDelete.yml deleted file mode 100644 index 464611a0f50..00000000000 --- a/test/spec/unified/findOneAndDelete.yml +++ /dev/null @@ -1,112 +0,0 @@ -description: findOneAndDelete - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndDelete is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'FindOneAndDelete is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 2, x: 22 } - - - description: 'FindOneAndDelete is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: { x: { $gte: 11 } } - sort: { x: 1 } - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndReplace-errorLabels.json b/test/spec/unified/findOneAndReplace-errorLabels.json deleted file mode 100644 index 78db52e75da..00000000000 --- a/test/spec/unified/findOneAndReplace-errorLabels.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "description": "findOneAndReplace-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndReplace-errorLabels.yml b/test/spec/unified/findOneAndReplace-errorLabels.yml deleted file mode 100644 index 254b61980db..00000000000 --- a/test/spec/unified/findOneAndReplace-errorLabels.yml +++ /dev/null @@ -1,165 +0,0 @@ -description: findOneAndReplace-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndReplace succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - # Driver retries operation and it succeeds - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndReplace fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndReplace succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndReplace succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndReplace-serverErrors.json b/test/spec/unified/findOneAndReplace-serverErrors.json deleted file mode 100644 index 1c355c3ebfb..00000000000 --- a/test/spec/unified/findOneAndReplace-serverErrors.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "findOneAndReplace-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndReplace-serverErrors.yml b/test/spec/unified/findOneAndReplace-serverErrors.yml deleted file mode 100644 index 090356baddf..00000000000 --- a/test/spec/unified/findOneAndReplace-serverErrors.yml +++ /dev/null @@ -1,69 +0,0 @@ -description: findOneAndReplace-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndReplace fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ findAndModify ] - closeConnection: true - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndReplace.json b/test/spec/unified/findOneAndReplace.json deleted file mode 100644 index 6d1cc17974d..00000000000 --- a/test/spec/unified/findOneAndReplace.json +++ /dev/null @@ -1,213 +0,0 @@ -{ - "description": "findOneAndReplace", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndReplace.yml b/test/spec/unified/findOneAndReplace.yml deleted file mode 100644 index 7a564143bd1..00000000000 --- a/test/spec/unified/findOneAndReplace.yml +++ /dev/null @@ -1,117 +0,0 @@ -description: findOneAndReplace - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndReplace is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndReplace is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndReplace is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - returnDocument: Before - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndUpdate-errorLabels.json b/test/spec/unified/findOneAndUpdate-errorLabels.json deleted file mode 100644 index 38b3f7ba44f..00000000000 --- a/test/spec/unified/findOneAndUpdate-errorLabels.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "description": "findOneAndUpdate-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndUpdate-errorLabels.yml b/test/spec/unified/findOneAndUpdate-errorLabels.yml deleted file mode 100644 index 034edbe77e7..00000000000 --- a/test/spec/unified/findOneAndUpdate-errorLabels.yml +++ /dev/null @@ -1,165 +0,0 @@ -description: findOneAndUpdate-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndUpdate succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - # Driver retries operation and it succeeds - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndUpdate fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndUpdate succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndUpdate succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ findAndModify ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndUpdate-serverErrors.json b/test/spec/unified/findOneAndUpdate-serverErrors.json deleted file mode 100644 index 150012ac724..00000000000 --- a/test/spec/unified/findOneAndUpdate-serverErrors.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "description": "findOneAndUpdate-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndUpdate-serverErrors.yml b/test/spec/unified/findOneAndUpdate-serverErrors.yml deleted file mode 100644 index 8f9765fc195..00000000000 --- a/test/spec/unified/findOneAndUpdate-serverErrors.yml +++ /dev/null @@ -1,69 +0,0 @@ -description: findOneAndUpdate-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndUpdate fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ findAndModify ] - closeConnection: true - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/findOneAndUpdate.json b/test/spec/unified/findOneAndUpdate.json deleted file mode 100644 index eb88fbe9b39..00000000000 --- a/test/spec/unified/findOneAndUpdate.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "description": "findOneAndUpdate", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/findOneAndUpdate.yml b/test/spec/unified/findOneAndUpdate.yml deleted file mode 100644 index 1a67f9b0477..00000000000 --- a/test/spec/unified/findOneAndUpdate.yml +++ /dev/null @@ -1,116 +0,0 @@ -description: findOneAndUpdate - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'FindOneAndUpdate is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndUpdate is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - returnDocument: Before - expectResult: { _id: 1, x: 11 } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'FindOneAndUpdate is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/handshakeError.json b/test/spec/unified/handshakeError.json deleted file mode 100644 index 3c464637598..00000000000 --- a/test/spec/unified/handshakeError.json +++ /dev/null @@ -1,2013 +0,0 @@ -{ - "description": "retryable writes handshake failures", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "auth": true - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "connectionCheckOutStartedEvent", - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "client.clientBulkWrite succeeds after retryable handshake network error", - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-handshake-tests.coll", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandSucceededEvent": { - "commandName": "bulkWrite" - } - } - ] - } - ] - }, - { - "description": "client.clientBulkWrite succeeds after retryable handshake server error (ShutdownInProgress)", - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-handshake-tests.coll", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandSucceededEvent": { - "commandName": "bulkWrite" - } - } - ] - } - ] - }, - { - "description": "collection.insertOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.insertOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.insertMany succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.insertMany succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.deleteOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandSucceededEvent": { - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "collection.deleteOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandSucceededEvent": { - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "collection.replaceOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.replaceOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.updateOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.updateOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndDelete succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndDelete succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndReplace succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndReplace succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndUpdate succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndUpdate succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.bulkWrite succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.bulkWrite succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/handshakeError.yml b/test/spec/unified/handshakeError.yml deleted file mode 100644 index 131bbf2e5c7..00000000000 --- a/test/spec/unified/handshakeError.yml +++ /dev/null @@ -1,875 +0,0 @@ -# Tests in this file are generated from handshakeError.yml.template. - -description: "retryable writes handshake failures" - -schemaVersion: "1.3" - -runOnRequirements: - - minServerVersion: "4.2" - topologies: [replicaset, sharded, load-balanced] - auth: true - -createEntities: - - client: - id: &client client - useMultipleMongoses: false - observeEvents: - - connectionCheckOutStartedEvent - - commandStartedEvent - - commandSucceededEvent - - commandFailedEvent - - database: - id: &database database - client: *client - databaseName: &databaseName retryable-writes-handshake-tests - - collection: - id: &collection collection - database: *database - collectionName: &collectionName coll - -initialData: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - -tests: - # Because setting a failPoint creates a connection in the connection pool, run - # a ping operation that fails immediately after the failPoint operation in - # order to discard the connection before running the actual operation to be - # tested. The saslContinue command is used to avoid SDAM errors. - # - # Description of events: - # - Failpoint operation. - # - Creates a connection in the connection pool that must be closed. - # - Ping operation. - # - Triggers failpoint (first time). - # - Closes the connection made by the fail point operation. - # - Test operation. - # - New connection is created. - # - Triggers failpoint (second time). - # - Tests whether operation successfully retries the handshake and succeeds. - - - description: "client.clientBulkWrite succeeds after retryable handshake network error" - runOnRequirements: - - minServerVersion: "8.0" # `bulkWrite` added to server 8.0 - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: clientBulkWrite - object: *client - arguments: - models: - - insertOne: - namespace: retryable-writes-handshake-tests.coll - document: { _id: 8, x: 88 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: bulkWrite - - commandSucceededEvent: - commandName: bulkWrite - - - description: "client.clientBulkWrite succeeds after retryable handshake server error (ShutdownInProgress)" - runOnRequirements: - - minServerVersion: "8.0" # `bulkWrite` added to server 8.0 - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: clientBulkWrite - object: *client - arguments: - models: - - insertOne: - namespace: retryable-writes-handshake-tests.coll - document: { _id: 8, x: 88 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: bulkWrite - - commandSucceededEvent: - commandName: bulkWrite - - - description: "collection.insertOne succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: insertOne - object: *collection - arguments: - document: { _id: 2, x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: insert - - commandSucceededEvent: - commandName: insert - - - description: "collection.insertOne succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: insertOne - object: *collection - arguments: - document: { _id: 2, x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: insert - - commandSucceededEvent: - commandName: insert - - - description: "collection.insertMany succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: insertMany - object: *collection - arguments: - documents: - - { _id: 2, x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: insert - - commandSucceededEvent: - commandName: insert - - - description: "collection.insertMany succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: insertMany - object: *collection - arguments: - documents: - - { _id: 2, x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: insert - - commandSucceededEvent: - commandName: insert - - - description: "collection.deleteOne succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: deleteOne - object: *collection - arguments: - filter: {} - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: delete - - commandSucceededEvent: - commandName: delete - - - description: "collection.deleteOne succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: deleteOne - object: *collection - arguments: - filter: {} - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: delete - - commandSucceededEvent: - commandName: delete - - - description: "collection.replaceOne succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: replaceOne - object: *collection - arguments: - filter: {} - replacement: { x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: update - - commandSucceededEvent: - commandName: update - - - description: "collection.replaceOne succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: replaceOne - object: *collection - arguments: - filter: {} - replacement: { x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: update - - commandSucceededEvent: - commandName: update - - - description: "collection.updateOne succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: updateOne - object: *collection - arguments: - filter: {} - update: { $set: { x: 22 } } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: update - - commandSucceededEvent: - commandName: update - - - description: "collection.updateOne succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: updateOne - object: *collection - arguments: - filter: {} - update: { $set: { x: 22 } } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: update - - commandSucceededEvent: - commandName: update - - - description: "collection.findOneAndDelete succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: findOneAndDelete - object: *collection - arguments: - filter: {} - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: findAndModify - - commandSucceededEvent: - commandName: findAndModify - - - description: "collection.findOneAndDelete succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: findOneAndDelete - object: *collection - arguments: - filter: {} - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: findAndModify - - commandSucceededEvent: - commandName: findAndModify - - - description: "collection.findOneAndReplace succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: findOneAndReplace - object: *collection - arguments: - filter: {} - replacement: { x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: findAndModify - - commandSucceededEvent: - commandName: findAndModify - - - description: "collection.findOneAndReplace succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: findOneAndReplace - object: *collection - arguments: - filter: {} - replacement: { x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: findAndModify - - commandSucceededEvent: - commandName: findAndModify - - - description: "collection.findOneAndUpdate succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: findOneAndUpdate - object: *collection - arguments: - filter: {} - update: { $set: { x: 22 } } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: findAndModify - - commandSucceededEvent: - commandName: findAndModify - - - description: "collection.findOneAndUpdate succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: findOneAndUpdate - object: *collection - arguments: - filter: {} - update: { $set: { x: 22 } } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: findAndModify - - commandSucceededEvent: - commandName: findAndModify - - - description: "collection.bulkWrite succeeds after retryable handshake network error" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: bulkWrite - object: *collection - arguments: - requests: - - insertOne: - document: { _id: 2, x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: insert - - commandSucceededEvent: - commandName: insert - - - description: "collection.bulkWrite succeeds after retryable handshake server error (ShutdownInProgress)" - operations: - - name: failPoint - object: testRunner - arguments: - client: *client - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ping, saslContinue] - closeConnection: true - - name: runCommand - object: *database - arguments: { commandName: ping, command: { ping: 1 } } - expectError: { isError: true } - - name: bulkWrite - object: *collection - arguments: - requests: - - insertOne: - document: { _id: 2, x: 22 } - expectEvents: - - client: *client - eventType: cmap - events: - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - { connectionCheckOutStartedEvent: {} } - - client: *client - events: - - commandStartedEvent: - command: { ping: 1 } - databaseName: *databaseName - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: insert - - commandSucceededEvent: - commandName: insert diff --git a/test/spec/unified/insertMany-errorLabels.json b/test/spec/unified/insertMany-errorLabels.json deleted file mode 100644 index 5254ba7cb2b..00000000000 --- a/test/spec/unified/insertMany-errorLabels.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "description": "insertMany-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertMany succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/insertMany-errorLabels.yml b/test/spec/unified/insertMany-errorLabels.yml deleted file mode 100644 index 631b3a5762e..00000000000 --- a/test/spec/unified/insertMany-errorLabels.yml +++ /dev/null @@ -1,185 +0,0 @@ -description: insertMany-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - -tests: - - - description: 'InsertMany succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: true - # Driver retries operation and it succeeds - expectResult: - $$unsetOrMatches: - insertedIds: - $$unsetOrMatches: - '0': 2 - '1': 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertMany fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: true - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertMany succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: true - expectResult: - $$unsetOrMatches: - insertedIds: - $$unsetOrMatches: - '0': 2 - '1': 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertMany succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: true - expectResult: - $$unsetOrMatches: - insertedIds: - $$unsetOrMatches: - '0': 2 - '1': 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } diff --git a/test/spec/unified/insertMany-serverErrors.json b/test/spec/unified/insertMany-serverErrors.json deleted file mode 100644 index f5f513603c6..00000000000 --- a/test/spec/unified/insertMany-serverErrors.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "description": "insertMany-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/insertMany-serverErrors.yml b/test/spec/unified/insertMany-serverErrors.yml deleted file mode 100644 index f229428bd75..00000000000 --- a/test/spec/unified/insertMany-serverErrors.yml +++ /dev/null @@ -1,68 +0,0 @@ -description: insertMany-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - -tests: - - - description: 'InsertMany fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ insert ] - closeConnection: true - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: true - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } diff --git a/test/spec/unified/insertMany.json b/test/spec/unified/insertMany.json deleted file mode 100644 index 47181d0a9ee..00000000000 --- a/test/spec/unified/insertMany.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "description": "insertMany", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany succeeds after one network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany with unordered execution", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": false - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany fails after multiple network errors", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": "alwaysOn", - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/insertMany.yml b/test/spec/unified/insertMany.yml deleted file mode 100644 index 0656b0c7ca1..00000000000 --- a/test/spec/unified/insertMany.yml +++ /dev/null @@ -1,135 +0,0 @@ -description: insertMany - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - -tests: - - - description: 'InsertMany succeeds after one network error' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: true - expectResult: - $$unsetOrMatches: - insertedIds: - $$unsetOrMatches: - '0': 2 - '1': 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertMany with unordered execution' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - ordered: false - expectResult: - $$unsetOrMatches: - insertedIds: - $$unsetOrMatches: - '0': 2 - '1': 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertMany fails after multiple network errors' - operations: - - - # Normally, a mongod will insert the documents as a batch with a single - # commit. If this fails, mongod may try to insert each document one at a - # time depending on the failure. Therefore our single insert command may - # trigger the failpoint twice on each driver attempt. This test - # permanently enables the fail point to ensure the retry attempt always - # fails. - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: alwaysOn - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: insertMany - arguments: - documents: - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - { _id: 4, x: 44 } - ordered: true - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } diff --git a/test/spec/unified/insertOne-errorLabels.json b/test/spec/unified/insertOne-errorLabels.json deleted file mode 100644 index 39f31a8aa66..00000000000 --- a/test/spec/unified/insertOne-errorLabels.json +++ /dev/null @@ -1,1127 +0,0 @@ -{ - "description": "insertOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "InsertOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ] - }, - { - "description": "InsertOne succeeds after NotWritablePrimary", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 10107, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 13436, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 13435, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11602, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after InterruptedAtShutdown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 91, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after HostNotFound", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after HostUnreachable", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 6, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after SocketException", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 9001, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after NetworkTimeout", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 89, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after ExceededTimeLimit", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 262, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError InterruptedAtShutdown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11600, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11602, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 189, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne fails after multiple retryable writeConcernErrors", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/insertOne-errorLabels.yml b/test/spec/unified/insertOne-errorLabels.yml deleted file mode 100644 index ce524217726..00000000000 --- a/test/spec/unified/insertOne-errorLabels.yml +++ /dev/null @@ -1,610 +0,0 @@ -description: insertOne-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: [] - -tests: - - - description: 'InsertOne succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - # Driver retries operation and it succeeds - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: [] - - - description: 'InsertOne succeeds after NotWritablePrimary' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 10107 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after NotPrimaryOrSecondary' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 13436 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after NotPrimaryNoSecondaryOk' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 13435 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after InterruptedDueToReplStateChange' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 11602 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after InterruptedAtShutdown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 11600 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 189 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 91 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after HostNotFound' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 7 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after HostUnreachable' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 6 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after SocketException' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 9001 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after NetworkTimeout' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 89 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after ExceededTimeLimit' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 262 - errorLabels: - - RetryableWriteError - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after WriteConcernError InterruptedAtShutdown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 11600 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 11602 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after WriteConcernError PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 189 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - - description: 'InsertOne fails after multiple retryable writeConcernErrors' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ insert ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 1, x: 11 } - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } # The write was still applied. diff --git a/test/spec/unified/insertOne-noWritesPerformedError.json b/test/spec/unified/insertOne-noWritesPerformedError.json deleted file mode 100644 index 3194e91c5ca..00000000000 --- a/test/spec/unified/insertOne-noWritesPerformedError.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "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": [] - } - ] - } - ] -} diff --git a/test/spec/unified/insertOne-noWritesPerformedError.yml b/test/spec/unified/insertOne-noWritesPerformedError.yml deleted file mode 100644 index 6d8e8e7d4b8..00000000000 --- a/test/spec/unified/insertOne-noWritesPerformedError.yml +++ /dev/null @@ -1,51 +0,0 @@ -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: [] diff --git a/test/spec/unified/insertOne-serverErrors.json b/test/spec/unified/insertOne-serverErrors.json deleted file mode 100644 index f404adcaf42..00000000000 --- a/test/spec/unified/insertOne-serverErrors.json +++ /dev/null @@ -1,865 +0,0 @@ -{ - "description": "retryable-writes insertOne serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "InsertOne succeeds after retryable writeConcernError", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "RetryableWriteError label is added based on top-level code in pre-4.4 server response", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "RetryableWriteError label is added based on writeConcernError in pre-4.4 mongod response", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "RetryableWriteError label is not added based on writeConcernError in pre-4.4 mongos response", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after connection failure", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne fails after connection failure when retryWrites option is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - } - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "InsertOne fails after Interrupted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601, - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "InsertOne fails after WriteConcernError Interrupted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 11601, - "errmsg": "operation was interrupted" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne fails after WriteConcernError WriteConcernFailed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 64, - "codeName": "WriteConcernFailed", - "errmsg": "waiting for replication timed out", - "errInfo": { - "wtimeout": true - } - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/insertOne-serverErrors.yml b/test/spec/unified/insertOne-serverErrors.yml deleted file mode 100644 index 95fa71ec790..00000000000 --- a/test/spec/unified/insertOne-serverErrors.yml +++ /dev/null @@ -1,406 +0,0 @@ -description: "retryable-writes insertOne serverErrors" - -schemaVersion: "1.9" - -runOnRequirements: - - minServerVersion: "4.0" - topologies: [ replicaset ] - - minServerVersion: "4.1.7" - topologies: [ sharded, load-balanced ] - -createEntities: - - client: - id: &client0 client0 - useMultipleMongoses: false - observeEvents: [ commandStartedEvent ] - - database: - id: &database0 database0 - client: *client0 - databaseName: &databaseName retryable-writes-tests - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collectionName coll - -initialData: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - description: "InsertOne succeeds after retryable writeConcernError" - runOnRequirements: - - minServerVersion: "4.3.1" # failCommand errorLabels option - operations: - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorLabels: [RetryableWriteError] # top-level error labels - writeConcernError: - code: 91 # ShutdownInProgress - errmsg: "Replication is being shut down" - - name: insertOne - object: *collection0 - arguments: - document: { _id: 3, x: 33 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } - expectEvents: - - client: *client0 - events: - - commandStartedEvent: - command: - insert: *collectionName - documents: [{ _id: 3, x: 33 }] - commandName: insert - databaseName: *databaseName - - commandStartedEvent: - command: - insert: *collectionName - documents: [{ _id: 3, x: 33 }] - commandName: insert - databaseName: *databaseName - outcome: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } # The write was still applied - - - description: "RetryableWriteError label is added based on top-level code in pre-4.4 server response" - runOnRequirements: - - minServerVersion: "4.2" - maxServerVersion: "4.2.99" - topologies: [ replicaset, sharded ] - operations: - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - # Trigger the fail point twice to allow asserting the error label in - # the retry attempt's response. - mode: { times: 2 } - data: - failCommands: [ "insert" ] - errorCode: 189 # PrimarySteppedDown - - name: insertOne - object: *collection0 - arguments: - document: { _id: 3, x: 33 } - expectError: - errorLabelsContain: [ "RetryableWriteError" ] - expectEvents: - - client: *client0 - events: - - commandStartedEvent: &insertCommandStartedEvent - command: - insert: *collectionName - documents: [{ _id: 3, x: 33 }] - commandName: insert - databaseName: *databaseName - - commandStartedEvent: *insertCommandStartedEvent - outcome: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: "RetryableWriteError label is added based on writeConcernError in pre-4.4 mongod response" - runOnRequirements: - - minServerVersion: "4.2" - maxServerVersion: "4.2.99" - topologies: [ replicaset ] - operations: - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - # Trigger the fail point twice to allow asserting the error label in - # the retry attempt's response. - mode: { times: 2 } - data: - failCommands: [ "insert" ] - writeConcernError: - code: 91 # ShutdownInProgress - errmsg: "Replication is being shut down" - - name: insertOne - object: *collection0 - arguments: - document: { _id: 3, x: 33 } - expectError: - errorLabelsContain: [ "RetryableWriteError" ] - expectEvents: - - client: *client0 - events: - - commandStartedEvent: *insertCommandStartedEvent - - commandStartedEvent: *insertCommandStartedEvent - outcome: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - # writeConcernError doesn't prevent the server from applying the write - - { _id: 3, x: 33 } - - - description: "RetryableWriteError label is not added based on writeConcernError in pre-4.4 mongos response" - runOnRequirements: - - minServerVersion: "4.2" - maxServerVersion: "4.2.99" - topologies: [ sharded ] - operations: - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - # Trigger the fail point only once since a RetryableWriteError label - # will not be added and the write will not be retried. - mode: { times: 1 } - data: - failCommands: [ "insert" ] - writeConcernError: - code: 91 # ShutdownInProgress - errmsg: "Replication is being shut down" - - name: insertOne - object: *collection0 - arguments: - document: { _id: 3, x: 33 } - expectError: - errorLabelsOmit: [ "RetryableWriteError" ] - expectEvents: - - client: *client0 - events: - - commandStartedEvent: *insertCommandStartedEvent - outcome: - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - # writeConcernError doesn't prevent the server from applying the write - - { _id: 3, x: 33 } - - - description: 'InsertOne succeeds after connection failure' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - closeConnection: true - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertOne fails after connection failure when retryWrites option is false' - operations: - - - object: testRunner - name: createEntities - arguments: - entities: - - client: - id: &client1 client1 - useMultipleMongoses: false - uriOptions: - retryWrites: false - - database: - id: &database1 database1 - client: *client1 - databaseName: *databaseName - - collection: - id: &collection1 collection1 - database: *database1 - collectionName: *collectionName - - - name: failPoint - object: testRunner - arguments: - client: *client1 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - closeConnection: true - - - object: *collection1 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectError: - isError: true - # If retryWrites is false, the driver should not add the - # RetryableWriteError label to the error. - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'InsertOne fails after Interrupted' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - errorCode: 11601 - closeConnection: false - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'InsertOne fails after WriteConcernError Interrupted' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - writeConcernError: - code: 11601 - errmsg: 'operation was interrupted' - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } # The write was still applied. - - - description: 'InsertOne fails after WriteConcernError WriteConcernFailed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ insert ] - writeConcernError: - code: 64 - codeName: WriteConcernFailed - errmsg: 'waiting for replication timed out' - errInfo: - wtimeout: true - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } # The write was still applied. - - - description: 'InsertOne fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ insert ] - closeConnection: true - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collectionName - databaseName: *databaseName - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/insertOne.json b/test/spec/unified/insertOne.json deleted file mode 100644 index 61957415ed6..00000000000 --- a/test/spec/unified/insertOne.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "description": "insertOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "InsertOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/insertOne.yml b/test/spec/unified/insertOne.yml deleted file mode 100644 index 50d7766b9c9..00000000000 --- a/test/spec/unified/insertOne.yml +++ /dev/null @@ -1,115 +0,0 @@ -description: insertOne - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'InsertOne is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertOne is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectResult: - $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 33 } - - - description: 'InsertOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: insertOne - arguments: - document: { _id: 3, x: 33 } - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/replaceOne-errorLabels.json b/test/spec/unified/replaceOne-errorLabels.json deleted file mode 100644 index 22c4561ae7b..00000000000 --- a/test/spec/unified/replaceOne-errorLabels.json +++ /dev/null @@ -1,300 +0,0 @@ -{ - "description": "replaceOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/replaceOne-errorLabels.yml b/test/spec/unified/replaceOne-errorLabels.yml deleted file mode 100644 index 38f271d5639..00000000000 --- a/test/spec/unified/replaceOne-errorLabels.yml +++ /dev/null @@ -1,170 +0,0 @@ -description: replaceOne-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'ReplaceOne succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - # Driver retries operation and it succeeds - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'ReplaceOne fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'ReplaceOne succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'ReplaceOne succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/replaceOne-serverErrors.json b/test/spec/unified/replaceOne-serverErrors.json deleted file mode 100644 index c957db7244a..00000000000 --- a/test/spec/unified/replaceOne-serverErrors.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "description": "replaceOne-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/replaceOne-serverErrors.yml b/test/spec/unified/replaceOne-serverErrors.yml deleted file mode 100644 index b6f2f65bdf9..00000000000 --- a/test/spec/unified/replaceOne-serverErrors.yml +++ /dev/null @@ -1,68 +0,0 @@ -description: replaceOne-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'ReplaceOne fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ update ] - closeConnection: true - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/replaceOne.json b/test/spec/unified/replaceOne.json deleted file mode 100644 index e58625bb5e2..00000000000 --- a/test/spec/unified/replaceOne.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "description": "replaceOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/replaceOne.yml b/test/spec/unified/replaceOne.yml deleted file mode 100644 index 0cc92fb28fb..00000000000 --- a/test/spec/unified/replaceOne.yml +++ /dev/null @@ -1,120 +0,0 @@ -description: replaceOne - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'ReplaceOne is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'ReplaceOne is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 111 } - - { _id: 2, x: 22 } - - - description: 'ReplaceOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: replaceOne - arguments: - filter: { _id: 1 } - replacement: { _id: 1, x: 111 } - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/updateMany.json b/test/spec/unified/updateMany.json deleted file mode 100644 index 260b7ad1c66..00000000000 --- a/test/spec/unified/updateMany.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "description": "updateMany", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany ignores retryWrites", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": {}, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/updateMany.yml b/test/spec/unified/updateMany.yml deleted file mode 100644 index a1843b9d2af..00000000000 --- a/test/spec/unified/updateMany.yml +++ /dev/null @@ -1,54 +0,0 @@ -description: updateMany - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: true - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'UpdateMany ignores retryWrites' - operations: - - - object: *collection0 - name: updateMany - arguments: - filter: { } - update: { $inc: { x: 1 } } - expectResult: - matchedCount: 2 - modifiedCount: 2 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 23 } diff --git a/test/spec/unified/updateOne-errorLabels.json b/test/spec/unified/updateOne-errorLabels.json deleted file mode 100644 index e44cef45f64..00000000000 --- a/test/spec/unified/updateOne-errorLabels.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "description": "updateOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/updateOne-errorLabels.yml b/test/spec/unified/updateOne-errorLabels.yml deleted file mode 100644 index f530e8dba41..00000000000 --- a/test/spec/unified/updateOne-errorLabels.yml +++ /dev/null @@ -1,170 +0,0 @@ -description: updateOne-errorLabels - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: 4.3.1 # failCommand errorLabels option - topologies: [ replicaset, sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'UpdateOne succeeds with RetryableWriteError from server' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 112 # WriteConflict, not a retryable error code - # Override server behavior: send RetryableWriteError label with non-retryable error code - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - # Driver retries operation and it succeeds - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'UpdateOne fails if server does not return RetryableWriteError' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 11600 # InterruptedAtShutdown, normally a retryable error code - errorLabels: [] # Override server behavior: do not send RetryableWriteError label with retryable code - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - # Driver does not retry operation because there was no RetryableWriteError label on response - expectError: - isError: true - errorLabelsOmit: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'UpdateOne succeeds after PrimarySteppedDown' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorCode: 189 - errorLabels: - - RetryableWriteError - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'UpdateOne succeeds after WriteConcernError ShutdownInProgress' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: [ update ] - errorLabels: - - RetryableWriteError - writeConcernError: - code: 91 - errmsg: 'Replication is being shut down' - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/updateOne-serverErrors.json b/test/spec/unified/updateOne-serverErrors.json deleted file mode 100644 index 648834ada4f..00000000000 --- a/test/spec/unified/updateOne-serverErrors.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "updateOne-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/updateOne-serverErrors.yml b/test/spec/unified/updateOne-serverErrors.yml deleted file mode 100644 index 6cd7281db17..00000000000 --- a/test/spec/unified/updateOne-serverErrors.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This file was created automatically using mongodb-spec-converter. -# Please review the generated file, then remove this notice. - -description: updateOne-serverErrors - -schemaVersion: '1.3' - -runOnRequirements: - - - minServerVersion: '4.0' - topologies: [ replicaset ] - - - minServerVersion: 4.1.7 - topologies: [ sharded, load-balanced ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'UpdateOne fails with a RetryableWriteError label after two connection failures' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: failCommand - mode: { times: 2 } - data: - failCommands: [ update ] - closeConnection: true - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectError: - isError: true - errorLabelsContain: - - RetryableWriteError - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } diff --git a/test/spec/unified/updateOne.json b/test/spec/unified/updateOne.json deleted file mode 100644 index 7947cef3c09..00000000000 --- a/test/spec/unified/updateOne.json +++ /dev/null @@ -1,394 +0,0 @@ -{ - "description": "updateOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3, - "x": 33 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 3 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3, - "x": 33 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 3 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3, - "x": 33 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/test/spec/unified/updateOne.yml b/test/spec/unified/updateOne.yml deleted file mode 100644 index 55c42c1f4f7..00000000000 --- a/test/spec/unified/updateOne.yml +++ /dev/null @@ -1,213 +0,0 @@ -description: updateOne - -schemaVersion: '1.0' - -runOnRequirements: - - - minServerVersion: '3.6' - topologies: [ replicaset ] - -createEntities: - - - client: - id: &client0 client0 - useMultipleMongoses: false - - - database: - id: &database0 database0 - client: *client0 - databaseName: &database_name retryable-writes-tests - - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection_name coll - -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - -tests: - - - description: 'UpdateOne is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'UpdateOne is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectResult: - matchedCount: 1 - modifiedCount: 1 - upsertedCount: 0 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 12 } - - { _id: 2, x: 22 } - - - description: 'UpdateOne is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 1 } - update: { $inc: { x: 1 } } - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - - description: 'UpdateOne with upsert is committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 3, x: 33 } - update: { $inc: { x: 1 } } - upsert: true - expectResult: - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 1 - upsertedId: 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 34 } - - - description: 'UpdateOne with upsert is not committed on first attempt' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 1 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 3, x: 33 } - update: { $inc: { x: 1 } } - upsert: true - expectResult: - matchedCount: 0 - modifiedCount: 0 - upsertedCount: 1 - upsertedId: 3 - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 } - - { _id: 3, x: 34 } - - - description: 'UpdateOne with upsert is never committed' - operations: - - - name: failPoint - object: testRunner - arguments: - client: *client0 - failPoint: - configureFailPoint: onPrimaryTransactionalWrite - mode: { times: 2 } - data: - failBeforeCommitExceptionCode: 1 - - - object: *collection0 - name: updateOne - arguments: - filter: { _id: 3, x: 33 } - update: { $inc: { x: 1 } } - upsert: true - expectError: - isError: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - { _id: 1, x: 11 } - - { _id: 2, x: 22 }