From 367f2e3674a3e4d1a257608ed20fe26990898d2e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Mon, 5 Feb 2024 14:34:08 -0500 Subject: [PATCH] mongos-pin-auto-tests.py and mongos-pin-auto.yml --- .../tests/legacy/mongos-pin-auto-tests.py | 340 ---- .../tests/legacy/mongos-pin-auto.yml | 1674 ----------------- .../tests/unified/mongos-pin-auto-tests.py | 334 ++++ .../tests/unified/mongos-pin-auto.yml | 1605 ++++++---------- 4 files changed, 884 insertions(+), 3069 deletions(-) delete mode 100644 source/transactions/tests/legacy/mongos-pin-auto-tests.py delete mode 100644 source/transactions/tests/legacy/mongos-pin-auto.yml create mode 100644 source/transactions/tests/unified/mongos-pin-auto-tests.py diff --git a/source/transactions/tests/legacy/mongos-pin-auto-tests.py b/source/transactions/tests/legacy/mongos-pin-auto-tests.py deleted file mode 100644 index df5905d8b2..0000000000 --- a/source/transactions/tests/legacy/mongos-pin-auto-tests.py +++ /dev/null @@ -1,340 +0,0 @@ -import itertools -import sys - -# Require Python 3.7+ for ordered dictionaries so that the order of the -# generated tests remain the same. -# Usage: -# python3.7 mongos-pin-auto-tests.py > mongos-pin-auto.yml -if sys.version_info[:2] < (3, 7): - print('ERROR: This script requires Python >= 3.7, not:') - print(sys.version) - print('Usage: python3.7 mongos-pin-auto-tests.py > mongos-pin-auto.yml') - exit(1) - -HEADER = '''# Autogenerated tests that transient errors in a transaction unpin the session. -# See mongos-pin-auto-tests.py -runOn: - - - minServerVersion: "4.1.8" - topology: ["sharded", "load-balanced"] - # serverless proxy doesn't append error labels to errors in transactions - # caused by failpoints (CLOUDP-88216) - serverless: "forbid" - -database_name: &database_name "transaction-tests" -collection_name: &collection_name "test" - -data: &data - - {_id: 1} - - {_id: 2} - -tests: - - description: remain pinned after non-transient Interrupted error on insertOne - useMultipleMongoses: true - operations: - - &startTransaction - name: startTransaction - object: session0 - - &initialCommand - name: insertOne - object: collection - arguments: - session: session0 - document: {_id: 3} - result: - insertedId: 3 - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 11601 - - name: insertOne - object: collection - arguments: - session: session0 - document: - _id: 4 - result: - errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"] - errorCodeName: Interrupted - - &assertSessionPinned - name: assertSessionPinned - object: testRunner - arguments: - session: session0 - - &commitTransaction - name: commitTransaction - object: session0 - - expectations: - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 3 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: true - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 4 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - commitTransaction: 1 - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - recoveryToken: 42 - command_name: commitTransaction - database_name: admin - - outcome: &outcome - collection: - data: - - {_id: 1} - - {_id: 2} - - {_id: 3} - - - description: unpin after transient error within a transaction - useMultipleMongoses: true - operations: - - &startTransaction - name: startTransaction - object: session0 - - &initialCommand - name: insertOne - object: collection - arguments: - session: session0 - document: - _id: 3 - result: - insertedId: 3 - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: ["insert"] - closeConnection: true - - name: insertOne - object: collection - arguments: - session: session0 - document: - _id: 4 - result: - errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] - # Session unpins from the first mongos after the insert error and - # abortTransaction succeeds immediately on any mongos. - - &assertSessionUnpinned - name: assertSessionUnpinned - object: testRunner - arguments: - session: session0 - - &abortTransaction - name: abortTransaction - object: session0 - - expectations: - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 3 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: true - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 4 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - abortTransaction: 1 - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - recoveryToken: 42 - command_name: abortTransaction - database_name: admin - - outcome: &outcome - collection: - data: *data - - # The rest of the tests in this file test every operation type against - # multiple types of transient errors (connection and error code).''' - -TEMPLATE = ''' - - description: {test_name} {error_name} error on {op_name} {command_name} - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {{times: 1}} - data: - failCommands: ["{command_name}"] - {error_data} - - name: {op_name} - object: {object_name} - arguments: - session: session0 - {op_args} - result: - {error_labels}: ["TransientTransactionError"] - - *{assertion} - - *abortTransaction - outcome: *outcome -''' - - -# Maps from op_name to (command_name, object_name, op_args) -OPS = { - # Write ops: - 'insertOne': ('insert', 'collection', r'document: {_id: 4}'), - 'insertMany': ('insert', 'collection', r'documents: [{_id: 4}, {_id: 5}]'), - 'updateOne': ('update', 'collection', r'''filter: {_id: 1} - update: {$inc: {x: 1}}'''), - 'replaceOne': ('update', 'collection', r'''filter: {_id: 1} - replacement: {y: 1}'''), - 'updateMany': ('update', 'collection', r'''filter: {_id: {$gte: 1}} - update: {$set: {z: 1}}'''), - 'deleteOne': ('delete', 'collection', r'filter: {_id: 1}'), - 'deleteMany': ('delete', 'collection', r'filter: {_id: {$gte: 1}}'), - 'findOneAndDelete': ('findAndModify', 'collection', r'filter: {_id: 1}'), - 'findOneAndUpdate': ('findAndModify', 'collection', r'''filter: {_id: 1} - update: {$inc: {x: 1}} - returnDocument: Before'''), - 'findOneAndReplace': ('findAndModify', 'collection', r'''filter: {_id: 1} - replacement: {y: 1} - returnDocument: Before'''), - # Bulk write insert/update/delete: - 'bulkWrite insert': ('insert', 'collection', r'''requests: - - name: insertOne - arguments: - document: {_id: 1}'''), - 'bulkWrite update': ('update', 'collection', r'''requests: - - name: updateOne - arguments: - filter: {_id: 1} - update: {$set: {x: 1}}'''), - 'bulkWrite delete': ('delete', 'collection', r'''requests: - - name: deleteOne - arguments: - filter: {_id: 1}'''), - # Read ops: - 'find': ('find', 'collection', r'filter: {_id: 1}'), - 'countDocuments': ('aggregate', 'collection', r'filter: {}'), - 'aggregate': ('aggregate', 'collection', r'pipeline: []'), - 'distinct': ('distinct', 'collection', r'fieldName: _id'), - # runCommand: - 'runCommand': ( - 'insert', - r'''database - command_name: insert''', # runCommand requires command_name. - r'''command: - insert: *collection_name - documents: - - _id : 1'''), -} - -# Maps from error_name to error_data. -NON_TRANSIENT_ERRORS = { - 'Interrupted': 'errorCode: 11601', -} - -# Maps from error_name to error_data. -TRANSIENT_ERRORS = { - 'connection': 'closeConnection: true', - 'ShutdownInProgress': 'errorCode: 91', -} - - -def create_pin_test(op_name, error_name): - test_name = 'remain pinned after non-transient' - assertion = 'assertSessionPinned' - error_labels = 'errorLabelsOmit' - command_name, object_name, op_args = OPS[op_name] - error_data = NON_TRANSIENT_ERRORS[error_name] - if op_name.startswith('bulkWrite'): - op_name = 'bulkWrite' - return TEMPLATE.format(**locals()) - - -def create_unpin_test(op_name, error_name): - test_name = 'unpin after transient' - assertion = 'assertSessionUnpinned' - error_labels = 'errorLabelsContain' - command_name, object_name, op_args = OPS[op_name] - error_data = TRANSIENT_ERRORS[error_name] - if op_name.startswith('bulkWrite'): - op_name = 'bulkWrite' - return TEMPLATE.format(**locals()) - -tests = [] -for op_name, error_name in itertools.product(OPS, NON_TRANSIENT_ERRORS): - tests.append(create_pin_test(op_name, error_name)) -for op_name, error_name in itertools.product(OPS, TRANSIENT_ERRORS): - tests.append(create_unpin_test(op_name, error_name)) - -print(HEADER) -print(''.join(tests)) diff --git a/source/transactions/tests/legacy/mongos-pin-auto.yml b/source/transactions/tests/legacy/mongos-pin-auto.yml deleted file mode 100644 index f5a5fe1571..0000000000 --- a/source/transactions/tests/legacy/mongos-pin-auto.yml +++ /dev/null @@ -1,1674 +0,0 @@ -# Autogenerated tests that transient errors in a transaction unpin the session. -# See mongos-pin-auto-tests.py -runOn: - - - minServerVersion: "4.1.8" - topology: ["sharded", "load-balanced"] - # serverless proxy doesn't append error labels to errors in transactions - # caused by failpoints (CLOUDP-88216) - serverless: "forbid" - -database_name: &database_name "transaction-tests" -collection_name: &collection_name "test" - -data: &data - - {_id: 1} - - {_id: 2} - -tests: - - description: remain pinned after non-transient Interrupted error on insertOne - useMultipleMongoses: true - operations: - - &startTransaction - name: startTransaction - object: session0 - - &initialCommand - name: insertOne - object: collection - arguments: - session: session0 - document: {_id: 3} - result: - insertedId: 3 - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 11601 - - name: insertOne - object: collection - arguments: - session: session0 - document: - _id: 4 - result: - errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"] - errorCodeName: Interrupted - - &assertSessionPinned - name: assertSessionPinned - object: testRunner - arguments: - session: session0 - - &commitTransaction - name: commitTransaction - object: session0 - - expectations: - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 3 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: true - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 4 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - commitTransaction: 1 - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - recoveryToken: 42 - command_name: commitTransaction - database_name: admin - - outcome: &outcome - collection: - data: - - {_id: 1} - - {_id: 2} - - {_id: 3} - - - description: unpin after transient error within a transaction - useMultipleMongoses: true - operations: - - &startTransaction - name: startTransaction - object: session0 - - &initialCommand - name: insertOne - object: collection - arguments: - session: session0 - document: - _id: 3 - result: - insertedId: 3 - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: ["insert"] - closeConnection: true - - name: insertOne - object: collection - arguments: - session: session0 - document: - _id: 4 - result: - errorLabelsContain: ["TransientTransactionError"] - errorLabelsOmit: ["UnknownTransactionCommitResult"] - # Session unpins from the first mongos after the insert error and - # abortTransaction succeeds immediately on any mongos. - - &assertSessionUnpinned - name: assertSessionUnpinned - object: testRunner - arguments: - session: session0 - - &abortTransaction - name: abortTransaction - object: session0 - - expectations: - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 3 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: true - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - insert: *collection_name - documents: - - _id: 4 - ordered: true - readConcern: - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - command_name: insert - database_name: *database_name - - command_started_event: - command: - abortTransaction: 1 - lsid: session0 - txnNumber: - $numberLong: "1" - startTransaction: - autocommit: false - writeConcern: - recoveryToken: 42 - command_name: abortTransaction - database_name: admin - - outcome: &outcome - collection: - data: *data - - # The rest of the tests in this file test every operation type against - # multiple types of transient errors (connection and error code). - - - description: remain pinned after non-transient Interrupted error on insertOne insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 11601 - - name: insertOne - object: collection - arguments: - session: session0 - document: {_id: 4} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on insertMany insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 11601 - - name: insertMany - object: collection - arguments: - session: session0 - documents: [{_id: 4}, {_id: 5}] - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on updateOne update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 11601 - - name: updateOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - update: {$inc: {x: 1}} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on replaceOne update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 11601 - - name: replaceOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - replacement: {y: 1} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on updateMany update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 11601 - - name: updateMany - object: collection - arguments: - session: session0 - filter: {_id: {$gte: 1}} - update: {$set: {z: 1}} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on deleteOne delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - errorCode: 11601 - - name: deleteOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on deleteMany delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - errorCode: 11601 - - name: deleteMany - object: collection - arguments: - session: session0 - filter: {_id: {$gte: 1}} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on findOneAndDelete findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - errorCode: 11601 - - name: findOneAndDelete - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on findOneAndUpdate findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - errorCode: 11601 - - name: findOneAndUpdate - object: collection - arguments: - session: session0 - filter: {_id: 1} - update: {$inc: {x: 1}} - returnDocument: Before - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on findOneAndReplace findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - errorCode: 11601 - - name: findOneAndReplace - object: collection - arguments: - session: session0 - filter: {_id: 1} - replacement: {y: 1} - returnDocument: Before - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on bulkWrite insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 11601 - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: insertOne - arguments: - document: {_id: 1} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on bulkWrite update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 11601 - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: updateOne - arguments: - filter: {_id: 1} - update: {$set: {x: 1}} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on bulkWrite delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - errorCode: 11601 - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: deleteOne - arguments: - filter: {_id: 1} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on find find - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["find"] - errorCode: 11601 - - name: find - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on countDocuments aggregate - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["aggregate"] - errorCode: 11601 - - name: countDocuments - object: collection - arguments: - session: session0 - filter: {} - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on aggregate aggregate - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["aggregate"] - errorCode: 11601 - - name: aggregate - object: collection - arguments: - session: session0 - pipeline: [] - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on distinct distinct - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["distinct"] - errorCode: 11601 - - name: distinct - object: collection - arguments: - session: session0 - fieldName: _id - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: remain pinned after non-transient Interrupted error on runCommand insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 11601 - - name: runCommand - object: database - command_name: insert - arguments: - session: session0 - command: - insert: *collection_name - documents: - - _id : 1 - result: - errorLabelsOmit: ["TransientTransactionError"] - - *assertSessionPinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on insertOne insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - closeConnection: true - - name: insertOne - object: collection - arguments: - session: session0 - document: {_id: 4} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on insertOne insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 91 - - name: insertOne - object: collection - arguments: - session: session0 - document: {_id: 4} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on insertMany insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - closeConnection: true - - name: insertMany - object: collection - arguments: - session: session0 - documents: [{_id: 4}, {_id: 5}] - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on insertMany insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 91 - - name: insertMany - object: collection - arguments: - session: session0 - documents: [{_id: 4}, {_id: 5}] - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on updateOne update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - closeConnection: true - - name: updateOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - update: {$inc: {x: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on updateOne update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 91 - - name: updateOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - update: {$inc: {x: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on replaceOne update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - closeConnection: true - - name: replaceOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - replacement: {y: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on replaceOne update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 91 - - name: replaceOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - replacement: {y: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on updateMany update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - closeConnection: true - - name: updateMany - object: collection - arguments: - session: session0 - filter: {_id: {$gte: 1}} - update: {$set: {z: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on updateMany update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 91 - - name: updateMany - object: collection - arguments: - session: session0 - filter: {_id: {$gte: 1}} - update: {$set: {z: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on deleteOne delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - closeConnection: true - - name: deleteOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on deleteOne delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - errorCode: 91 - - name: deleteOne - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on deleteMany delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - closeConnection: true - - name: deleteMany - object: collection - arguments: - session: session0 - filter: {_id: {$gte: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on deleteMany delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - errorCode: 91 - - name: deleteMany - object: collection - arguments: - session: session0 - filter: {_id: {$gte: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on findOneAndDelete findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - closeConnection: true - - name: findOneAndDelete - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on findOneAndDelete findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - errorCode: 91 - - name: findOneAndDelete - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on findOneAndUpdate findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - closeConnection: true - - name: findOneAndUpdate - object: collection - arguments: - session: session0 - filter: {_id: 1} - update: {$inc: {x: 1}} - returnDocument: Before - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on findOneAndUpdate findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - errorCode: 91 - - name: findOneAndUpdate - object: collection - arguments: - session: session0 - filter: {_id: 1} - update: {$inc: {x: 1}} - returnDocument: Before - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on findOneAndReplace findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - closeConnection: true - - name: findOneAndReplace - object: collection - arguments: - session: session0 - filter: {_id: 1} - replacement: {y: 1} - returnDocument: Before - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on findOneAndReplace findAndModify - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["findAndModify"] - errorCode: 91 - - name: findOneAndReplace - object: collection - arguments: - session: session0 - filter: {_id: 1} - replacement: {y: 1} - returnDocument: Before - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on bulkWrite insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - closeConnection: true - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: insertOne - arguments: - document: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on bulkWrite insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 91 - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: insertOne - arguments: - document: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on bulkWrite update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - closeConnection: true - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: updateOne - arguments: - filter: {_id: 1} - update: {$set: {x: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on bulkWrite update - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["update"] - errorCode: 91 - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: updateOne - arguments: - filter: {_id: 1} - update: {$set: {x: 1}} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on bulkWrite delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - closeConnection: true - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: deleteOne - arguments: - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on bulkWrite delete - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["delete"] - errorCode: 91 - - name: bulkWrite - object: collection - arguments: - session: session0 - requests: - - name: deleteOne - arguments: - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on find find - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["find"] - closeConnection: true - - name: find - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on find find - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["find"] - errorCode: 91 - - name: find - object: collection - arguments: - session: session0 - filter: {_id: 1} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on countDocuments aggregate - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["aggregate"] - closeConnection: true - - name: countDocuments - object: collection - arguments: - session: session0 - filter: {} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on countDocuments aggregate - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["aggregate"] - errorCode: 91 - - name: countDocuments - object: collection - arguments: - session: session0 - filter: {} - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on aggregate aggregate - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["aggregate"] - closeConnection: true - - name: aggregate - object: collection - arguments: - session: session0 - pipeline: [] - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on aggregate aggregate - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["aggregate"] - errorCode: 91 - - name: aggregate - object: collection - arguments: - session: session0 - pipeline: [] - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on distinct distinct - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["distinct"] - closeConnection: true - - name: distinct - object: collection - arguments: - session: session0 - fieldName: _id - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on distinct distinct - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["distinct"] - errorCode: 91 - - name: distinct - object: collection - arguments: - session: session0 - fieldName: _id - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient connection error on runCommand insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - closeConnection: true - - name: runCommand - object: database - command_name: insert - arguments: - session: session0 - command: - insert: *collection_name - documents: - - _id : 1 - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - - - description: unpin after transient ShutdownInProgress error on runCommand insert - useMultipleMongoses: true - operations: - - *startTransaction - - *initialCommand - - name: targetedFailPoint - object: testRunner - arguments: - session: session0 - failPoint: - configureFailPoint: failCommand - mode: {times: 1} - data: - failCommands: ["insert"] - errorCode: 91 - - name: runCommand - object: database - command_name: insert - arguments: - session: session0 - command: - insert: *collection_name - documents: - - _id : 1 - result: - errorLabelsContain: ["TransientTransactionError"] - - *assertSessionUnpinned - - *abortTransaction - outcome: *outcome - diff --git a/source/transactions/tests/unified/mongos-pin-auto-tests.py b/source/transactions/tests/unified/mongos-pin-auto-tests.py new file mode 100644 index 0000000000..10325dbfd8 --- /dev/null +++ b/source/transactions/tests/unified/mongos-pin-auto-tests.py @@ -0,0 +1,334 @@ +import itertools +import sys + +# Require Python 3.7+ for ordered dictionaries so that the order of the +# generated tests remain the same. +# Usage: +# python3.7 mongos-pin-auto-tests.py > mongos-pin-auto.yml +if sys.version_info[:2] < (3, 7): + print('ERROR: This script requires Python >= 3.7, not:') + print(sys.version) + print('Usage: python3.7 mongos-pin-auto-tests.py > mongos-pin-auto.yml') + exit(1) + +HEADER = '''# Autogenerated tests that transient errors in a transaction unpin the session. +# See mongos-pin-auto-tests.py + +description: mongos-pin-auto + +schemaVersion: '1.3' + +runOnRequirements: + - minServerVersion: "4.1.8" + topologies: [ sharded, load-balanced ] + # serverless proxy doesn't append error labels to errors in transactions + # caused by failpoints (CLOUDP-88216) + serverless: "forbid" + +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: true + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database_name transaction-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection_name test + - session: + id: &session0 session0 + client: *client0 + +initialData: + - collectionName: *collection_name + databaseName: *database_name + documents: &data + - { _id: 1 } + - { _id: 2 } + +tests: + - description: remain pinned after non-transient Interrupted error on insertOne + operations: + - &startTransaction + object: session0 + name: startTransaction + - &initialCommand + object: *collection0 + name: insertOne + arguments: + session: *session0 + document: { _id: 3 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } } + - object: testRunner + name: targetedFailPoint + arguments: + session: *session0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ "insert" ] + errorCode: 11601 + - object: *collection0 + name: insertOne + arguments: + session: *session0 + document: { _id: 4 } + expectError: + errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"] + errorCodeName: Interrupted + - &assertSessionPinned + object: testRunner + name: assertSessionPinned + arguments: + session: *session0 + - &commitTransaction + object: *session0 + name: commitTransaction + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection_name + documents: + - { _id: 3 } + ordered: true + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: true + autocommit: false + writeConcern: { $$exists: false } + commandName: insert + databaseName: *database_name + - commandStartedEvent: + command: + insert: *collection_name + documents: + - { _id: 4 } + ordered: true + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + commandName: insert + databaseName: *database_name + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + recoveryToken: { $$exists: true } + commandName: commitTransaction + databaseName: admin + outcome: + - collectionName: *collection_name + databaseName: *database_name + documents: + - { _id: 1 } + - { _id: 2 } + - { _id: 3 } + + - description: 'unpin after transient error within a transaction' + operations: + - *startTransaction + - *initialCommand + - object: testRunner + name: targetedFailPoint + arguments: + session: *session0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ "insert" ] + closeConnection: true + - object: *collection0 + name: insertOne + arguments: + session: *session0 + document: { _id: 4 } + expectError: + errorLabelsContain: ["TransientTransactionError"] + errorLabelsOmit: ["UnknownTransactionCommitResult"] + - &assertSessionUnpinned + object: testRunner + name: assertSessionUnpinned + arguments: + session: *session0 + - &abortTransaction + object: *session0 + name: abortTransaction + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection_name + documents: + - { _id: 3 } + ordered: true + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: true + autocommit: false + writeConcern: { $$exists: false } + commandName: insert + databaseName: *database_name + - commandStartedEvent: + command: + insert: *collection_name + documents: + - { _id: 4 } + ordered: true + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + commandName: insert + databaseName: *database_name + - commandStartedEvent: + command: + abortTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + recoveryToken: { $$exists: true } + commandName: abortTransaction + databaseName: admin + outcome: &outcome + - collectionName: *collection_name + databaseName: *database_name + documents: *data + + # The rest of the tests in this file test every operation type against + # multiple types of transient errors (connection and error code).''' + +TEMPLATE = ''' + - description: {test_name} {error_name} error on {op_name} {command_name} + operations: + - *startTransaction + - *initialCommand + - name: targetedFailPoint + object: testRunner + arguments: + session: *session0 + failPoint: + configureFailPoint: failCommand + mode: {{times: 1}} + data: + failCommands: ["{command_name}"] + {error_data} + - name: {op_name} + object: {object_name} + arguments: + session: *session0 + {op_args} + expectError: + {error_labels}: ["TransientTransactionError"] + - *{assertion} + - *abortTransaction + outcome: *outcome +''' + + +# Maps from op_name to (command_name, object_name, op_args) +OPS = { + # Write ops: + 'insertOne': ('insert', '*collection0', r'document: { _id: 4 }'), + 'insertMany': ('insert', '*collection0', r'documents: [ { _id: 4 }, { _id: 5 } ]'), + 'updateOne': ('update', '*collection0', r'''filter: { _id: 1 } + update: { $inc: { x: 1 } }'''), + 'replaceOne': ('update', '*collection0', r'''filter: { _id: 1 } + replacement: { y: 1 }'''), + 'updateMany': ('update', '*collection0', r'''filter: { _id: { $gte: 1 } } + update: {$set: { z: 1 } }'''), + 'deleteOne': ('delete', '*collection0', r'filter: { _id: 1 }'), + 'deleteMany': ('delete', '*collection0', r'filter: { _id: { $gte: 1 } }'), + 'findOneAndDelete': ('findAndModify', '*collection0', r'filter: { _id: 1 }'), + 'findOneAndUpdate': ('findAndModify', '*collection0', r'''filter: { _id: 1 } + update: { $inc: { x: 1 } } + returnDocument: Before'''), + 'findOneAndReplace': ('findAndModify', '*collection0', r'''filter: { _id: 1 } + replacement: { y: 1 } + returnDocument: Before'''), + # Bulk write insert/update/delete: + 'bulkWrite insert': ('insert', '*collection0', r'''requests: + - name: insertOne + document: { _id: 1 }'''), + 'bulkWrite update': ('update', '*collection0', r'''requests: + - name: updateOne + filter: { _id: 1 } + update: { $set: { x: 1 } }'''), + 'bulkWrite delete': ('delete', '*collection0', r'''requests: + - name: deleteOne + filter: { _id: 1 }'''), + # Read ops: + 'find': ('find', '*collection0', r'filter: { _id: 1 }'), + 'countDocuments': ('aggregate', '*collection0', r'filter: {}'), + 'aggregate': ('aggregate', '*collection0', r'pipeline: []'), + 'distinct': ('distinct', '*collection0', r'fieldName: _id'), + # runCommand: + 'runCommand': ('insert', '*database0', r'''commandName: insert + command: + insert: *collection_name + documents: + - { _id : 1 }'''), +} + +# Maps from error_name to error_data. +NON_TRANSIENT_ERRORS = { + 'Interrupted': 'errorCode: 11601', +} + +# Maps from error_name to error_data. +TRANSIENT_ERRORS = { + 'connection': 'closeConnection: true', + 'ShutdownInProgress': 'errorCode: 91', +} + + +def create_pin_test(op_name, error_name): + test_name = 'remain pinned after non-transient' + assertion = 'assertSessionPinned' + error_labels = 'errorLabelsOmit' + command_name, object_name, op_args = OPS[op_name] + error_data = NON_TRANSIENT_ERRORS[error_name] + if op_name.startswith('bulkWrite'): + op_name = 'bulkWrite' + return TEMPLATE.format(**locals()) + + +def create_unpin_test(op_name, error_name): + test_name = 'unpin after transient' + assertion = 'assertSessionUnpinned' + error_labels = 'errorLabelsContain' + command_name, object_name, op_args = OPS[op_name] + error_data = TRANSIENT_ERRORS[error_name] + if op_name.startswith('bulkWrite'): + op_name = 'bulkWrite' + return TEMPLATE.format(**locals()) + + +tests = [] +for op_name, error_name in itertools.product(OPS, NON_TRANSIENT_ERRORS): + tests.append(create_pin_test(op_name, error_name)) +for op_name, error_name in itertools.product(OPS, TRANSIENT_ERRORS): + tests.append(create_unpin_test(op_name, error_name)) + +print(HEADER) +print(''.join(tests)) diff --git a/source/transactions/tests/unified/mongos-pin-auto.yml b/source/transactions/tests/unified/mongos-pin-auto.yml index ee2c3e1b7c..4db5e33427 100644 --- a/source/transactions/tests/unified/mongos-pin-auto.yml +++ b/source/transactions/tests/unified/mongos-pin-auto.yml @@ -1,92 +1,71 @@ -# This file was created automatically using mongodb-spec-converter. -# Please review the generated file, then remove this notice. +# Autogenerated tests that transient errors in a transaction unpin the session. +# See mongos-pin-auto-tests.py description: mongos-pin-auto + schemaVersion: '1.3' + +runOnRequirements: + - minServerVersion: "4.1.8" + topologies: [ sharded, load-balanced ] + # serverless proxy doesn't append error labels to errors in transactions + # caused by failpoints (CLOUDP-88216) + serverless: "forbid" + createEntities: - - - client: + - client: id: &client0 client0 - useMultipleMongoses: false - observeEvents: - - commandStartedEvent - - - database: + useMultipleMongoses: true + observeEvents: [ commandStartedEvent ] + - database: id: &database0 database0 client: *client0 databaseName: &database_name transaction-tests - - - collection: + - collection: id: &collection0 collection0 database: *database0 collectionName: &collection_name test - - - session: + - session: id: &session0 session0 client: *client0 - - - session: - id: &session1 session1 - client: *client0 -runOnRequirements: - - - minServerVersion: 4.1.8 - serverless: forbid - topologies: - - sharded - - load-balanced + initialData: - - - collectionName: *collection_name + - collectionName: *collection_name databaseName: *database_name documents: &data - - - _id: 1 - - - _id: 2 + - { _id: 1 } + - { _id: 2 } + tests: - - - description: 'remain pinned after non-transient Interrupted error on insertOne' - useMultipleMongoses: true + - description: remain pinned after non-transient Interrupted error on insertOne operations: - &startTransaction - object: *session0 + object: session0 name: startTransaction - &initialCommand object: *collection0 name: insertOne arguments: session: *session0 - document: - _id: 3 - expectResult: - $$unsetOrMatches: - insertedId: - $$unsetOrMatches: 3 - - - object: testRunner + document: { _id: 3 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } } + - object: testRunner name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: { times: 1 } data: - failCommands: - - insert + failCommands: [ "insert" ] errorCode: 11601 - - - object: *collection0 + - object: *collection0 name: insertOne arguments: session: *session0 - document: - _id: 4 + document: { _id: 4 } expectError: - errorLabelsOmit: - - TransientTransactionError - - UnknownTransactionCommitResult + errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"] errorCodeName: Interrupted - &assertSessionPinned object: testRunner @@ -97,121 +76,77 @@ tests: object: *session0 name: commitTransaction expectEvents: - - - client: *client0 + - client: *client0 events: - - - commandStartedEvent: + - commandStartedEvent: command: insert: *collection_name documents: - - - _id: 3 + - { _id: 3 } ordered: true - readConcern: - $$exists: false - lsid: - $$sessionLsid: *session0 - txnNumber: - $numberLong: '1' + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } startTransaction: true autocommit: false - writeConcern: - $$exists: false + writeConcern: { $$exists: false } commandName: insert databaseName: *database_name - - - commandStartedEvent: + - commandStartedEvent: command: insert: *collection_name documents: - - - _id: 4 + - { _id: 4 } ordered: true - readConcern: - $$exists: false - lsid: - $$sessionLsid: *session0 - txnNumber: - $numberLong: '1' - startTransaction: - $$exists: false + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } autocommit: false - writeConcern: - $$exists: false + writeConcern: { $$exists: false } commandName: insert databaseName: *database_name - - - commandStartedEvent: + - commandStartedEvent: command: commitTransaction: 1 - lsid: - $$sessionLsid: *session0 - txnNumber: - $numberLong: '1' - startTransaction: - $$exists: false + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } autocommit: false - writeConcern: - $$exists: false - recoveryToken: - $$exists: true + writeConcern: { $$exists: false } + recoveryToken: { $$exists: true } commandName: commitTransaction databaseName: admin - outcome: &outcome - - - collectionName: *collection_name + outcome: + - collectionName: *collection_name databaseName: *database_name documents: - - - _id: 1 - - - _id: 2 - - - _id: 3 - - - description: 'unpin after transient error within a transaction' - useMultipleMongoses: true + - { _id: 1 } + - { _id: 2 } + - { _id: 3 } + + - description: 'unpin after transient error within a transaction' operations: - - &startTransaction - object: *session0 - name: startTransaction - - &initialCommand - object: *collection0 - name: insertOne - arguments: - session: *session0 - document: - _id: 3 - expectResult: - $$unsetOrMatches: - insertedId: - $$unsetOrMatches: 3 - - - object: testRunner + - *startTransaction + - *initialCommand + - object: testRunner name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: { times: 1 } data: - failCommands: - - insert + failCommands: [ "insert" ] closeConnection: true - - - object: *collection0 + - object: *collection0 name: insertOne arguments: session: *session0 - document: - _id: 4 + document: { _id: 4 } expectError: - errorLabelsContain: - - TransientTransactionError - errorLabelsOmit: - - UnknownTransactionCommitResult + errorLabelsContain: ["TransientTransactionError"] + errorLabelsOmit: ["UnknownTransactionCommitResult"] - &assertSessionUnpinned object: testRunner name: assertSessionUnpinned @@ -221,1896 +156,1456 @@ tests: object: *session0 name: abortTransaction expectEvents: - - - client: *client0 + - client: *client0 events: - - - commandStartedEvent: + - commandStartedEvent: command: insert: *collection_name documents: - - - _id: 3 + - { _id: 3 } ordered: true - readConcern: - $$exists: false - lsid: - $$sessionLsid: *session0 - txnNumber: - $numberLong: '1' + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } startTransaction: true autocommit: false - writeConcern: - $$exists: false + writeConcern: { $$exists: false } commandName: insert databaseName: *database_name - - - commandStartedEvent: + - commandStartedEvent: command: insert: *collection_name documents: - - - _id: 4 + - { _id: 4 } ordered: true - readConcern: - $$exists: false - lsid: - $$sessionLsid: *session0 - txnNumber: - $numberLong: '1' - startTransaction: - $$exists: false + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } autocommit: false - writeConcern: - $$exists: false + writeConcern: { $$exists: false } commandName: insert databaseName: *database_name - - - commandStartedEvent: + - commandStartedEvent: command: abortTransaction: 1 - lsid: - $$sessionLsid: *session0 - txnNumber: - $numberLong: '1' - startTransaction: - $$exists: false + lsid: { $$sessionLsid: *session0 } + txnNumber: { $numberLong: '1' } + startTransaction: { $$exists: false } autocommit: false - writeConcern: - $$exists: false - recoveryToken: - $$exists: true + writeConcern: { $$exists: false } + recoveryToken: { $$exists: true } commandName: abortTransaction databaseName: admin outcome: &outcome - - - collectionName: *collection_name + - collectionName: *collection_name databaseName: *database_name documents: *data - - - description: 'remain pinned after non-transient Interrupted error on insertOne insert' - useMultipleMongoses: true + + # The rest of the tests in this file test every operation type against + # multiple types of transient errors (connection and error code). + + - description: remain pinned after non-transient Interrupted error on insertOne insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 11601 - - + - name: insertOne object: *collection0 - name: insertOne arguments: session: *session0 - document: - _id: 4 + document: { _id: 4 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on insertMany insert' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on insertMany insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 11601 - - + - name: insertMany object: *collection0 - name: insertMany arguments: session: *session0 - documents: - - - _id: 4 - - - _id: 5 + documents: [ { _id: 4 }, { _id: 5 } ] expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on updateOne update' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on updateOne update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 11601 - - + - name: updateOne object: *collection0 - name: updateOne arguments: session: *session0 - filter: - _id: 1 - update: - $inc: - x: 1 + filter: { _id: 1 } + update: { $inc: { x: 1 } } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on replaceOne update' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on replaceOne update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 11601 - - + - name: replaceOne object: *collection0 - name: replaceOne arguments: session: *session0 - filter: - _id: 1 - replacement: - 'y': 1 + filter: { _id: 1 } + replacement: { y: 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on updateMany update' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on updateMany update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 11601 - - + - name: updateMany object: *collection0 - name: updateMany arguments: session: *session0 - filter: - _id: - $gte: 1 - update: - $set: - z: 1 + filter: { _id: { $gte: 1 } } + update: {$set: { z: 1 } } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on deleteOne delete' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on deleteOne delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] errorCode: 11601 - - + - name: deleteOne object: *collection0 - name: deleteOne arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on deleteMany delete' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on deleteMany delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] errorCode: 11601 - - + - name: deleteMany object: *collection0 - name: deleteMany arguments: session: *session0 - filter: - _id: - $gte: 1 + filter: { _id: { $gte: 1 } } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on findOneAndDelete findAndModify' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on findOneAndDelete findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] errorCode: 11601 - - + - name: findOneAndDelete object: *collection0 - name: findOneAndDelete arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on findOneAndUpdate findAndModify' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on findOneAndUpdate findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] errorCode: 11601 - - + - name: findOneAndUpdate object: *collection0 - name: findOneAndUpdate arguments: session: *session0 - filter: - _id: 1 - update: - $inc: - x: 1 + filter: { _id: 1 } + update: { $inc: { x: 1 } } returnDocument: Before expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on findOneAndReplace findAndModify' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on findOneAndReplace findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] errorCode: 11601 - - + - name: findOneAndReplace object: *collection0 - name: findOneAndReplace arguments: session: *session0 - filter: - _id: 1 - replacement: - 'y': 1 + filter: { _id: 1 } + replacement: { y: 1 } returnDocument: Before expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on bulkWrite insert' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on bulkWrite insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 11601 - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - insertOne: - document: - _id: 1 + - name: insertOne + document: { _id: 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on bulkWrite update' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on bulkWrite update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 11601 - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - updateOne: - filter: - _id: 1 - update: - $set: - x: 1 + - name: updateOne + filter: { _id: 1 } + update: { $set: { x: 1 } } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on bulkWrite delete' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on bulkWrite delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] errorCode: 11601 - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - deleteOne: - filter: - _id: 1 + - name: deleteOne + filter: { _id: 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on find find' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on find find operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - find + failCommands: ["find"] errorCode: 11601 - - + - name: find object: *collection0 - name: find arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on countDocuments aggregate' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on countDocuments aggregate operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - aggregate + failCommands: ["aggregate"] errorCode: 11601 - - + - name: countDocuments object: *collection0 - name: countDocuments arguments: session: *session0 - filter: { } + filter: {} expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on aggregate aggregate' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on aggregate aggregate operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - aggregate + failCommands: ["aggregate"] errorCode: 11601 - - + - name: aggregate object: *collection0 - name: aggregate arguments: session: *session0 pipeline: [] expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on distinct distinct' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on distinct distinct operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - distinct + failCommands: ["distinct"] errorCode: 11601 - - + - name: distinct object: *collection0 - name: distinct arguments: session: *session0 fieldName: _id expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'remain pinned after non-transient Interrupted error on runCommand insert' - useMultipleMongoses: true + + - description: remain pinned after non-transient Interrupted error on runCommand insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 11601 - - + - name: runCommand object: *database0 - name: runCommand arguments: session: *session0 + commandName: insert command: insert: *collection_name documents: - - - _id: 1 - commandName: insert + - { _id : 1 } expectError: - errorLabelsOmit: - - TransientTransactionError + errorLabelsOmit: ["TransientTransactionError"] - *assertSessionPinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on insertOne insert' - useMultipleMongoses: true + + - description: unpin after transient connection error on insertOne insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] closeConnection: true - - + - name: insertOne object: *collection0 - name: insertOne arguments: session: *session0 - document: - _id: 4 + document: { _id: 4 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on insertOne insert' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on insertOne insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 91 - - + - name: insertOne object: *collection0 - name: insertOne arguments: session: *session0 - document: - _id: 4 + document: { _id: 4 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on insertMany insert' - useMultipleMongoses: true + + - description: unpin after transient connection error on insertMany insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] closeConnection: true - - + - name: insertMany object: *collection0 - name: insertMany arguments: session: *session0 - documents: - - - _id: 4 - - - _id: 5 + documents: [ { _id: 4 }, { _id: 5 } ] expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on insertMany insert' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on insertMany insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 91 - - + - name: insertMany object: *collection0 - name: insertMany arguments: session: *session0 - documents: - - - _id: 4 - - - _id: 5 + documents: [ { _id: 4 }, { _id: 5 } ] expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on updateOne update' - useMultipleMongoses: true + + - description: unpin after transient connection error on updateOne update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] closeConnection: true - - + - name: updateOne object: *collection0 - name: updateOne arguments: session: *session0 - filter: - _id: 1 - update: - $inc: - x: 1 + filter: { _id: 1 } + update: { $inc: { x: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on updateOne update' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on updateOne update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 91 - - + - name: updateOne object: *collection0 - name: updateOne arguments: session: *session0 - filter: - _id: 1 - update: - $inc: - x: 1 + filter: { _id: 1 } + update: { $inc: { x: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on replaceOne update' - useMultipleMongoses: true + + - description: unpin after transient connection error on replaceOne update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] closeConnection: true - - + - name: replaceOne object: *collection0 - name: replaceOne arguments: session: *session0 - filter: - _id: 1 - replacement: - 'y': 1 + filter: { _id: 1 } + replacement: { y: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on replaceOne update' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on replaceOne update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 91 - - + - name: replaceOne object: *collection0 - name: replaceOne arguments: session: *session0 - filter: - _id: 1 - replacement: - 'y': 1 + filter: { _id: 1 } + replacement: { y: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on updateMany update' - useMultipleMongoses: true + + - description: unpin after transient connection error on updateMany update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] closeConnection: true - - + - name: updateMany object: *collection0 - name: updateMany arguments: session: *session0 - filter: - _id: - $gte: 1 - update: - $set: - z: 1 + filter: { _id: { $gte: 1 } } + update: {$set: { z: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on updateMany update' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on updateMany update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 91 - - + - name: updateMany object: *collection0 - name: updateMany arguments: session: *session0 - filter: - _id: - $gte: 1 - update: - $set: - z: 1 + filter: { _id: { $gte: 1 } } + update: {$set: { z: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on deleteOne delete' - useMultipleMongoses: true + + - description: unpin after transient connection error on deleteOne delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] closeConnection: true - - + - name: deleteOne object: *collection0 - name: deleteOne arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on deleteOne delete' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on deleteOne delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] errorCode: 91 - - + - name: deleteOne object: *collection0 - name: deleteOne arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on deleteMany delete' - useMultipleMongoses: true + + - description: unpin after transient connection error on deleteMany delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] closeConnection: true - - + - name: deleteMany object: *collection0 - name: deleteMany arguments: session: *session0 - filter: - _id: - $gte: 1 + filter: { _id: { $gte: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on deleteMany delete' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on deleteMany delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] errorCode: 91 - - + - name: deleteMany object: *collection0 - name: deleteMany arguments: session: *session0 - filter: - _id: - $gte: 1 + filter: { _id: { $gte: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on findOneAndDelete findAndModify' - useMultipleMongoses: true + + - description: unpin after transient connection error on findOneAndDelete findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] closeConnection: true - - + - name: findOneAndDelete object: *collection0 - name: findOneAndDelete arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on findOneAndDelete findAndModify' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on findOneAndDelete findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] errorCode: 91 - - + - name: findOneAndDelete object: *collection0 - name: findOneAndDelete arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on findOneAndUpdate findAndModify' - useMultipleMongoses: true + + - description: unpin after transient connection error on findOneAndUpdate findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] closeConnection: true - - + - name: findOneAndUpdate object: *collection0 - name: findOneAndUpdate arguments: session: *session0 - filter: - _id: 1 - update: - $inc: - x: 1 + filter: { _id: 1 } + update: { $inc: { x: 1 } } returnDocument: Before expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on findOneAndUpdate findAndModify' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on findOneAndUpdate findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] errorCode: 91 - - + - name: findOneAndUpdate object: *collection0 - name: findOneAndUpdate arguments: session: *session0 - filter: - _id: 1 - update: - $inc: - x: 1 + filter: { _id: 1 } + update: { $inc: { x: 1 } } returnDocument: Before expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on findOneAndReplace findAndModify' - useMultipleMongoses: true + + - description: unpin after transient connection error on findOneAndReplace findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] closeConnection: true - - + - name: findOneAndReplace object: *collection0 - name: findOneAndReplace arguments: session: *session0 - filter: - _id: 1 - replacement: - 'y': 1 + filter: { _id: 1 } + replacement: { y: 1 } returnDocument: Before expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on findOneAndReplace findAndModify' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on findOneAndReplace findAndModify operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - findAndModify + failCommands: ["findAndModify"] errorCode: 91 - - + - name: findOneAndReplace object: *collection0 - name: findOneAndReplace arguments: session: *session0 - filter: - _id: 1 - replacement: - 'y': 1 + filter: { _id: 1 } + replacement: { y: 1 } returnDocument: Before expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on bulkWrite insert' - useMultipleMongoses: true + + - description: unpin after transient connection error on bulkWrite insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] closeConnection: true - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - insertOne: - document: - _id: 1 + - name: insertOne + document: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on bulkWrite insert' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on bulkWrite insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 91 - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - insertOne: - document: - _id: 1 + - name: insertOne + document: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on bulkWrite update' - useMultipleMongoses: true + + - description: unpin after transient connection error on bulkWrite update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] closeConnection: true - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - updateOne: - filter: - _id: 1 - update: - $set: - x: 1 + - name: updateOne + filter: { _id: 1 } + update: { $set: { x: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on bulkWrite update' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on bulkWrite update operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - update + failCommands: ["update"] errorCode: 91 - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - updateOne: - filter: - _id: 1 - update: - $set: - x: 1 + - name: updateOne + filter: { _id: 1 } + update: { $set: { x: 1 } } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on bulkWrite delete' - useMultipleMongoses: true + + - description: unpin after transient connection error on bulkWrite delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] closeConnection: true - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - deleteOne: - filter: - _id: 1 + - name: deleteOne + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on bulkWrite delete' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on bulkWrite delete operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - delete + failCommands: ["delete"] errorCode: 91 - - + - name: bulkWrite object: *collection0 - name: bulkWrite arguments: session: *session0 requests: - - - deleteOne: - filter: - _id: 1 + - name: deleteOne + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on find find' - useMultipleMongoses: true + + - description: unpin after transient connection error on find find operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - find + failCommands: ["find"] closeConnection: true - - + - name: find object: *collection0 - name: find arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on find find' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on find find operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - find + failCommands: ["find"] errorCode: 91 - - + - name: find object: *collection0 - name: find arguments: session: *session0 - filter: - _id: 1 + filter: { _id: 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on countDocuments aggregate' - useMultipleMongoses: true + + - description: unpin after transient connection error on countDocuments aggregate operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - aggregate + failCommands: ["aggregate"] closeConnection: true - - + - name: countDocuments object: *collection0 - name: countDocuments arguments: session: *session0 - filter: { } + filter: {} expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on countDocuments aggregate' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on countDocuments aggregate operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - aggregate + failCommands: ["aggregate"] errorCode: 91 - - + - name: countDocuments object: *collection0 - name: countDocuments arguments: session: *session0 - filter: { } + filter: {} expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on aggregate aggregate' - useMultipleMongoses: true + + - description: unpin after transient connection error on aggregate aggregate operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - aggregate + failCommands: ["aggregate"] closeConnection: true - - + - name: aggregate object: *collection0 - name: aggregate arguments: session: *session0 pipeline: [] expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on aggregate aggregate' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on aggregate aggregate operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - aggregate + failCommands: ["aggregate"] errorCode: 91 - - + - name: aggregate object: *collection0 - name: aggregate arguments: session: *session0 pipeline: [] expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on distinct distinct' - useMultipleMongoses: true + + - description: unpin after transient connection error on distinct distinct operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - distinct + failCommands: ["distinct"] closeConnection: true - - + - name: distinct object: *collection0 - name: distinct arguments: session: *session0 fieldName: _id expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on distinct distinct' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on distinct distinct operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - distinct + failCommands: ["distinct"] errorCode: 91 - - + - name: distinct object: *collection0 - name: distinct arguments: session: *session0 fieldName: _id expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient connection error on runCommand insert' - useMultipleMongoses: true + + - description: unpin after transient connection error on runCommand insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] closeConnection: true - - + - name: runCommand object: *database0 - name: runCommand arguments: session: *session0 + commandName: insert command: insert: *collection_name documents: - - - _id: 1 - commandName: insert + - { _id : 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction outcome: *outcome - - - description: 'unpin after transient ShutdownInProgress error on runCommand insert' - useMultipleMongoses: true + + - description: unpin after transient ShutdownInProgress error on runCommand insert operations: - *startTransaction - *initialCommand - - + - name: targetedFailPoint object: testRunner - name: targetedFailPoint arguments: session: *session0 failPoint: configureFailPoint: failCommand - mode: - times: 1 + mode: {times: 1} data: - failCommands: - - insert + failCommands: ["insert"] errorCode: 91 - - + - name: runCommand object: *database0 - name: runCommand arguments: session: *session0 + commandName: insert command: insert: *collection_name documents: - - - _id: 1 - commandName: insert + - { _id : 1 } expectError: - errorLabelsContain: - - TransientTransactionError + errorLabelsContain: ["TransientTransactionError"] - *assertSessionUnpinned - *abortTransaction - outcome: *outcome \ No newline at end of file + outcome: *outcome +