{ "description": "retryable-commit-errorLabels", "schemaVersion": "1.4", "runOnRequirements": [ { "minServerVersion": "4.3.1", "topologies": [ "replicaset", "sharded", "load-balanced" ] } ], "createEntities": [ { "client": { "id": "client0", "useMultipleMongoses": false, "observeEvents": [ "commandStartedEvent" ] } }, { "database": { "id": "database0", "client": "client0", "databaseName": "transaction-tests" } }, { "collection": { "id": "collection0", "database": "database0", "collectionName": "test" } }, { "session": { "id": "session0", "client": "client0" } }, { "client": { "id": "client1", "useMultipleMongoses": false, "uriOptions": { "retryWrites": false }, "observeEvents": [ "commandStartedEvent" ] } }, { "database": { "id": "database1", "client": "client1", "databaseName": "transaction-tests" } }, { "collection": { "id": "collection1", "database": "database1", "collectionName": "test" } }, { "session": { "id": "session1", "client": "client1" } } ], "initialData": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [] } ], "tests": [ { "description": "commitTransaction does not retry error without RetryableWriteError label", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client1", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 11600, "errorLabels": [] } } } }, { "object": "session1", "name": "startTransaction" }, { "object": "collection1", "name": "insertOne", "arguments": { "session": "session1", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session1", "name": "commitTransaction", "expectError": { "errorLabelsOmit": [ "RetryableWriteError", "TransientTransactionError" ] } } ], "expectEvents": [ { "client": "client1", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session1" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session1" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [] } ] }, { "description": "commitTransaction retries once with RetryableWriteError from server", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client1", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 112, "errorLabels": [ "RetryableWriteError" ] } } } }, { "object": "session1", "name": "startTransaction" }, { "object": "collection1", "name": "insertOne", "arguments": { "session": "session1", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session1", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client1", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session1" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session1" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session1" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after NotWritablePrimary", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 10107, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after NotPrimaryOrSecondary", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 13436, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after NotPrimaryNoSecondaryOk", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 13435, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after InterruptedDueToReplStateChange", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 11602, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after PrimarySteppedDown", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 189, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after HostNotFound", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 7, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after HostUnreachable", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 6, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after SocketException", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 9001, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after NetworkTimeout", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 89, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after WriteConcernError InterruptedAtShutdown", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorLabels": [ "RetryableWriteError" ], "writeConcernError": { "code": 11600, "errmsg": "Replication is being shut down" } } } } }, { "object": "session0", "name": "startTransaction", "arguments": { "writeConcern": { "w": "majority" } } }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority" } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after WriteConcernError InterruptedDueToReplStateChange", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorLabels": [ "RetryableWriteError" ], "writeConcernError": { "code": 11602, "errmsg": "Replication is being shut down" } } } } }, { "object": "session0", "name": "startTransaction", "arguments": { "writeConcern": { "w": "majority" } } }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority" } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after WriteConcernError PrimarySteppedDown", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorLabels": [ "RetryableWriteError" ], "writeConcernError": { "code": 189, "errmsg": "Replication is being shut down" } } } } }, { "object": "session0", "name": "startTransaction", "arguments": { "writeConcern": { "w": "majority" } } }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority" } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after WriteConcernError ShutdownInProgress", "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorLabels": [ "RetryableWriteError" ], "writeConcernError": { "code": 91, "errmsg": "Replication is being shut down" } } } } }, { "object": "session0", "name": "startTransaction", "arguments": { "writeConcern": { "w": "majority" } } }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority" } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after InterruptedAtShutdown", "runOnRequirements": [ { "serverless": "forbid" } ], "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 11600, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] }, { "description": "commitTransaction succeeds after ShutdownInProgress", "runOnRequirements": [ { "serverless": "forbid" } ], "operations": [ { "object": "testRunner", "name": "failPoint", "arguments": { "client": "client0", "failPoint": { "configureFailPoint": "failCommand", "mode": { "times": 1 }, "data": { "failCommands": [ "commitTransaction" ], "errorCode": 91, "errorLabels": [ "RetryableWriteError" ], "closeConnection": false } } } }, { "object": "session0", "name": "startTransaction" }, { "object": "collection0", "name": "insertOne", "arguments": { "session": "session0", "document": { "_id": 1 } }, "expectResult": { "$$unsetOrMatches": { "insertedId": { "$$unsetOrMatches": 1 } } } }, { "object": "session0", "name": "commitTransaction" } ], "expectEvents": [ { "client": "client0", "events": [ { "commandStartedEvent": { "command": { "insert": "test", "documents": [ { "_id": 1 } ], "ordered": true, "readConcern": { "$$exists": false }, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": true, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "insert", "databaseName": "transaction-tests" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "$$exists": false } }, "commandName": "commitTransaction", "databaseName": "admin" } }, { "commandStartedEvent": { "command": { "commitTransaction": 1, "lsid": { "$$sessionLsid": "session0" }, "txnNumber": { "$numberLong": "1" }, "startTransaction": { "$$exists": false }, "autocommit": false, "writeConcern": { "w": "majority", "wtimeout": 10000 } }, "commandName": "commitTransaction", "databaseName": "admin" } } ] } ], "outcome": [ { "collectionName": "test", "databaseName": "transaction-tests", "documents": [ { "_id": 1 } ] } ] } ] }