Unverified Commit fe4ff68d authored by Andreas Braun's avatar Andreas Braun

Merge pull request #725

parents 8060d725 8f7d7f8e
......@@ -185,9 +185,6 @@ final class Context
$clientOptions = isset($test->clientOptions) ? (array) $test->clientOptions : [];
// TODO: Remove this once retryWrites=true by default (see: PHPC-1324)
$clientOptions['retryWrites'] = true;
if (isset($test->outcome->collection->name)) {
$o->outcomeCollectionName = $test->outcome->collection->name;
}
......
......@@ -126,7 +126,7 @@ final class ResultExpectation
public static function fromRetryableWrites(stdClass $outcome, $defaultAssertionType)
{
if (property_exists($outcome, 'result')) {
if (property_exists($outcome, 'result') && ! self::isErrorResult($outcome->result)) {
$assertionType = $outcome->result === null ? self::ASSERT_NULL : $defaultAssertionType;
$expectedValue = $outcome->result;
} else {
......
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "BulkWrite succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
}
}
},
{
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 2
},
"update": {
"$inc": {
"x": 1
}
}
}
}
],
"options": {
"ordered": true
}
}
},
"outcome": {
"result": {
"deletedCount": 1,
"insertedCount": 1,
"insertedIds": {
"1": 3
},
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0,
"upsertedIds": {}
},
"collection": {
"data": [
{
"_id": 2,
"x": 23
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "BulkWrite fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
}
}
},
{
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 2
},
"update": {
"$inc": {
"x": 1
}
}
}
}
],
"options": {
"ordered": true
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"update"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -117,7 +120,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -186,6 +192,81 @@
]
}
}
},
{
"description": "BulkWrite fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"update"
],
"closeConnection": true
}
},
"operation": {
"name": "bulkWrite",
"arguments": {
"requests": [
{
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
}
}
},
{
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
{
"name": "updateOne",
"arguments": {
"filter": {
"_id": 2
},
"update": {
"$inc": {
"x": 1
}
}
}
}
],
"options": {
"ordered": true
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "DeleteOne succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"delete"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
}
}
},
"outcome": {
"result": {
"deletedCount": 1
},
"collection": {
"data": [
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "DeleteOne fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"delete"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"delete"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -73,7 +76,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -98,6 +104,49 @@
]
}
}
},
{
"description": "DeleteOne fails with RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"delete"
],
"closeConnection": true
}
},
"operation": {
"name": "deleteOne",
"arguments": {
"filter": {
"_id": 1
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "FindOneAndDelete succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"findAndModify"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "findOneAndDelete",
"arguments": {
"filter": {
"x": {
"$gte": 11
}
},
"sort": {
"x": 1
}
}
},
"outcome": {
"result": {
"_id": 1,
"x": 11
},
"collection": {
"data": [
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndDelete fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"findAndModify"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "findOneAndDelete",
"arguments": {
"filter": {
"x": {
"$gte": 11
}
},
"sort": {
"x": 1
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"findAndModify"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -79,7 +82,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -110,6 +116,54 @@
]
}
}
},
{
"description": "FindOneAndDelete fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"findAndModify"
],
"closeConnection": true
}
},
"operation": {
"name": "findOneAndDelete",
"arguments": {
"filter": {
"x": {
"$gte": 11
}
},
"sort": {
"x": 1
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "FindOneAndReplace succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"findAndModify"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"_id": 1,
"x": 111
},
"returnDocument": "Before"
}
},
"outcome": {
"result": {
"_id": 1,
"x": 11
},
"collection": {
"data": [
{
"_id": 1,
"x": 111
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndReplace fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"findAndModify"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"_id": 1,
"x": 111
},
"returnDocument": "Before"
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"findAndModify"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -83,7 +86,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -118,6 +124,54 @@
]
}
}
},
{
"description": "FindOneAndReplace fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"findAndModify"
],
"closeConnection": true
}
},
"operation": {
"name": "findOneAndReplace",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"_id": 1,
"x": 111
},
"returnDocument": "Before"
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "FindOneAndUpdate succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"findAndModify"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"returnDocument": "Before"
}
},
"outcome": {
"result": {
"_id": 1,
"x": 11
},
"collection": {
"data": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "FindOneAndUpdate fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"findAndModify"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"returnDocument": "Before"
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"findAndModify"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -84,7 +87,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -120,6 +126,55 @@
]
}
}
},
{
"description": "FindOneAndUpdate fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"findAndModify"
],
"closeConnection": true
}
},
"operation": {
"name": "findOneAndUpdate",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
},
"returnDocument": "Before"
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
}
],
"tests": [
{
"description": "InsertMany succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "insertMany",
"arguments": {
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"options": {
"ordered": true
}
}
},
"outcome": {
"result": {
"insertedIds": {
"0": 2,
"1": 3
}
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "InsertMany fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "insertMany",
"arguments": {
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"options": {
"ordered": true
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
}
]
}
......@@ -31,7 +31,10 @@
"failCommands": [
"insert"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -90,7 +93,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -136,6 +142,55 @@
]
}
}
},
{
"description": "InsertMany fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"insert"
],
"closeConnection": true
}
},
"operation": {
"name": "insertMany",
"arguments": {
"documents": [
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
],
"options": {
"ordered": true
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [],
"tests": [
{
"description": "InsertOne succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "insertOne",
"arguments": {
"document": {
"_id": 1,
"x": 11
}
}
},
"outcome": {
"result": {
"insertedId": 1
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
}
]
}
}
},
{
"description": "InsertOne fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "insertOne",
"arguments": {
"document": {
"_id": 1,
"x": 11
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": []
}
}
}
]
}
......@@ -69,6 +69,53 @@
}
}
},
{
"description": "InsertOne fails after connection failure when retryWrites option is false",
"clientOptions": {
"retryWrites": false
},
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"closeConnection": true
}
},
"operation": {
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "InsertOne succeeds after NotMaster",
"failPoint": {
......@@ -81,6 +128,9 @@
"insert"
],
"errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -127,6 +177,9 @@
"insert"
],
"errorCode": 13436,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -173,6 +226,9 @@
"insert"
],
"errorCode": 13435,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -208,7 +264,7 @@
}
},
{
"description": "InsertOne succeeds after InterruptedDueToStepDown",
"description": "InsertOne succeeds after InterruptedDueToReplStateChange",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -219,6 +275,9 @@
"insert"
],
"errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -265,6 +324,9 @@
"insert"
],
"errorCode": 11600,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -311,6 +373,9 @@
"insert"
],
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -357,6 +422,9 @@
"insert"
],
"errorCode": 91,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -403,6 +471,9 @@
"insert"
],
"errorCode": 7,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -449,6 +520,9 @@
"insert"
],
"errorCode": 6,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -495,6 +569,9 @@
"insert"
],
"errorCode": 9001,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -541,6 +618,58 @@
"insert"
],
"errorCode": 89,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
"operation": {
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
"outcome": {
"result": {
"insertedId": 3
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
}
},
{
"description": "InsertOne succeeds after ExceededTimeLimit",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"insert"
],
"errorCode": 262,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -601,6 +730,11 @@
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
......@@ -628,7 +762,10 @@
],
"writeConcernError": {
"code": 11600,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -664,7 +801,7 @@
}
},
{
"description": "InsertOne succeeds after WriteConcernError InterruptedDueToStepDown",
"description": "InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -676,7 +813,10 @@
],
"writeConcernError": {
"code": 11602,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -724,7 +864,10 @@
],
"writeConcernError": {
"code": 189,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -772,7 +915,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -835,6 +981,11 @@
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
......@@ -881,6 +1032,11 @@
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
......@@ -931,6 +1087,11 @@
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
......@@ -948,6 +1109,50 @@
]
}
}
},
{
"description": "InsertOne fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"insert"
],
"closeConnection": true
}
},
"operation": {
"name": "insertOne",
"arguments": {
"document": {
"_id": 3,
"x": 33
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "ReplaceOne succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"_id": 1,
"x": 111
}
}
},
"outcome": {
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
},
"collection": {
"data": [
{
"_id": 1,
"x": 111
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "ReplaceOne fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"_id": 1,
"x": 111
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"update"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -83,7 +86,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -118,6 +124,53 @@
]
}
}
},
{
"description": "ReplaceOne fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"update"
],
"closeConnection": true
}
},
"operation": {
"name": "replaceOne",
"arguments": {
"filter": {
"_id": 1
},
"replacement": {
"_id": 1,
"x": 111
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
],
"tests": [
{
"description": "UpdateOne succeeds with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
},
"outcome": {
"result": {
"matchedCount": 1,
"modifiedCount": 1,
"upsertedCount": 0
},
"collection": {
"data": [
{
"_id": 1,
"x": 12
},
{
"_id": 2,
"x": 22
}
]
}
}
},
{
"description": "UpdateOne fails if server does not return RetryableWriteError",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"update"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operation": {
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -35,7 +35,10 @@
"failCommands": [
"update"
],
"errorCode": 189
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operation": {
......@@ -84,7 +87,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -120,6 +126,54 @@
]
}
}
},
{
"description": "UpdateOne fails with a RetryableWriteError label after two connection failures",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"update"
],
"closeConnection": true
}
},
"operation": {
"name": "updateOne",
"arguments": {
"filter": {
"_id": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
},
"outcome": {
"error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": {
"data": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
}
]
}
}
}
]
}
......@@ -235,7 +235,8 @@
"errorLabelsOmit": [
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
],
"errorContains": "E11000"
}
}
],
......
......@@ -304,6 +304,9 @@
"commitTransaction"
],
"errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......
......@@ -192,7 +192,7 @@
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": 1
......@@ -243,7 +243,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null
},
......@@ -308,7 +308,7 @@
},
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": 1
......@@ -335,7 +335,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null
},
......@@ -380,7 +380,7 @@
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "majority"
"level": "snapshot"
},
"writeConcern": {
"w": "majority"
......@@ -412,7 +412,7 @@
},
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": 1
......@@ -439,7 +439,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null
},
......@@ -481,7 +481,7 @@
"description": "withTransaction explicit transaction options override client options",
"useMultipleMongoses": true,
"clientOptions": {
"readConcernLevel": "majority",
"readConcernLevel": "local",
"w": "majority"
},
"operations": [
......@@ -508,7 +508,7 @@
},
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": 1
......@@ -535,7 +535,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null
},
......
......@@ -458,7 +458,8 @@
"errorLabelsOmit": [
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
],
"errorContains": "E11000"
}
},
{
......
......@@ -304,9 +304,7 @@
"$set": {
"x": 1
}
},
"multi": false,
"upsert": false
}
},
{
"q": {
......@@ -317,7 +315,6 @@
"x": 2
}
},
"multi": false,
"upsert": true
}
],
......@@ -379,9 +376,7 @@
},
"u": {
"y": 1
},
"multi": false,
"upsert": false
}
},
{
"q": {
......@@ -389,9 +384,7 @@
},
"u": {
"y": 2
},
"multi": false,
"upsert": false
}
}
],
"ordered": true,
......@@ -454,8 +447,7 @@
"z": 1
}
},
"multi": true,
"upsert": false
"multi": true
}
],
"ordered": true,
......
......@@ -40,8 +40,7 @@
"$inc": {
"count": 1
}
},
"upsert": false
}
},
"result": {
"matchedCount": 1,
......@@ -65,8 +64,7 @@
"$inc": {
"count": 1
}
},
"upsert": false
}
},
"result": {
"matchedCount": 1,
......@@ -93,9 +91,7 @@
"$inc": {
"count": 1
}
},
"multi": false,
"upsert": false
}
}
],
"ordered": true,
......@@ -123,9 +119,7 @@
"$inc": {
"count": 1
}
},
"multi": false,
"upsert": false
}
}
],
"ordered": true,
......@@ -212,8 +206,7 @@
"$inc": {
"count": 1
}
},
"upsert": false
}
},
"result": {
"matchedCount": 1,
......@@ -260,9 +253,7 @@
"$inc": {
"count": 1
}
},
"multi": false,
"upsert": false
}
}
],
"ordered": true,
......
......@@ -42,7 +42,8 @@
"errorLabelsOmit": [
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
],
"errorContains": "E11000"
}
},
{
......@@ -407,6 +408,7 @@
"TransientTransactionError"
],
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
]
}
......@@ -460,7 +462,7 @@
}
},
{
"description": "add transient label to connection errors",
"description": "add TransientTransactionError label to connection errors",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -662,7 +664,7 @@
}
},
{
"description": "add unknown commit label to connection errors",
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -698,6 +700,7 @@
"object": "session0",
"result": {
"errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
......@@ -800,7 +803,7 @@
}
},
{
"description": "add unknown commit label to retryable commit errors",
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -810,7 +813,10 @@
"failCommands": [
"commitTransaction"
],
"errorCode": 11602
"errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operations": [
......@@ -836,6 +842,7 @@
"object": "session0",
"result": {
"errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
......@@ -938,7 +945,7 @@
}
},
{
"description": "add unknown commit label to writeConcernError ShutdownInProgress",
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -950,7 +957,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
},
......@@ -984,6 +994,7 @@
"object": "session0",
"result": {
"errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
......@@ -1088,7 +1099,7 @@
}
},
{
"description": "add unknown commit label to writeConcernError WriteConcernFailed",
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1137,6 +1148,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError"
]
}
......@@ -1219,7 +1231,7 @@
}
},
{
"description": "add unknown commit label to writeConcernError WriteConcernFailed with wtimeout",
"description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1272,6 +1284,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError"
]
}
......@@ -1354,7 +1367,7 @@
}
},
{
"description": "omit unknown commit label to writeConcernError UnsatisfiableWriteConcern",
"description": "omit UnknownTransactionCommitResult label from writeConcernError UnsatisfiableWriteConcern",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1400,6 +1413,7 @@
"object": "session0",
"result": {
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
......@@ -1460,7 +1474,7 @@
}
},
{
"description": "omit unknown commit label to writeConcernError UnknownReplWriteConcern",
"description": "omit UnknownTransactionCommitResult label from writeConcernError UnknownReplWriteConcern",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1506,6 +1520,7 @@
"object": "session0",
"result": {
"errorLabelsOmit": [
"RetryableWriteConcern",
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
......@@ -1566,7 +1581,7 @@
}
},
{
"description": "do not add unknown commit label to MaxTimeMSExpired inside transactions",
"description": "do not add UnknownTransactionCommitResult label to MaxTimeMSExpired inside transactions",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1613,6 +1628,7 @@
},
"result": {
"errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult",
"TransientTransactionError"
]
......@@ -1695,7 +1711,7 @@
}
},
{
"description": "add unknown commit label to MaxTimeMSExpired",
"description": "add UnknownTransactionCommitResult label to MaxTimeMSExpired",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1742,6 +1758,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError"
]
}
......@@ -1826,7 +1843,7 @@
}
},
{
"description": "add unknown commit label to writeConcernError MaxTimeMSExpired",
"description": "add UnknownTransactionCommitResult label to writeConcernError MaxTimeMSExpired",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -1876,6 +1893,7 @@
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError"
]
}
......
......@@ -181,7 +181,10 @@
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
}
}
}
......
......@@ -875,7 +875,7 @@
"failCommands": [
"commitTransaction"
],
"errorCode": 50
"errorCode": 51
}
}
}
......@@ -887,7 +887,7 @@
"errorLabelsOmit": [
"TransientTransactionError"
],
"errorCode": 50
"errorCode": 51
}
},
{
......
......@@ -39,7 +39,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
}
}
}
......@@ -110,7 +110,7 @@
"cursor": {},
"lsid": "session0",
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"txnNumber": {
"$numberLong": "1"
......@@ -202,7 +202,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
}
}
}
......@@ -274,7 +274,7 @@
"batchSize": 3,
"lsid": "session0",
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"txnNumber": {
"$numberLong": "1"
......@@ -389,7 +389,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
}
}
}
......@@ -484,7 +484,7 @@
},
"lsid": "session0",
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"txnNumber": {
"$numberLong": "1"
......@@ -608,7 +608,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
}
}
}
......@@ -664,7 +664,7 @@
"key": "_id",
"lsid": "session0",
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"txnNumber": {
"$numberLong": "1"
......@@ -741,7 +741,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
}
}
}
......@@ -780,7 +780,7 @@
"find": "test",
"lsid": "session0",
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"txnNumber": {
"$numberLong": "1"
......
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [],
"tests": [
{
"description": "abortTransaction only retries once with RetryableWriteError from server",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"abortTransaction"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "abortTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"abortTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "abortTransaction",
"database_name": "admin"
}
},
{
"command_started_event": {
"command": {
"abortTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "abortTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": []
}
}
},
{
"description": "abortTransaction does not retry without RetryableWriteError label",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"abortTransaction"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "abortTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"abortTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "abortTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": []
}
}
}
]
}
......@@ -413,6 +413,9 @@
"abortTransaction"
],
"errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -514,6 +517,9 @@
"abortTransaction"
],
"errorCode": 13436,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -615,6 +621,9 @@
"abortTransaction"
],
"errorCode": 13435,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -716,6 +725,9 @@
"abortTransaction"
],
"errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -817,6 +829,9 @@
"abortTransaction"
],
"errorCode": 11600,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -918,6 +933,9 @@
"abortTransaction"
],
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1019,6 +1037,9 @@
"abortTransaction"
],
"errorCode": 91,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1120,6 +1141,9 @@
"abortTransaction"
],
"errorCode": 7,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1221,6 +1245,9 @@
"abortTransaction"
],
"errorCode": 6,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1322,6 +1349,9 @@
"abortTransaction"
],
"errorCode": 9001,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1423,6 +1453,9 @@
"abortTransaction"
],
"errorCode": 89,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1525,6 +1558,9 @@
],
"writeConcernError": {
"code": 11600,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......@@ -1639,6 +1675,9 @@
],
"writeConcernError": {
"code": 11602,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......@@ -1753,6 +1792,9 @@
],
"writeConcernError": {
"code": 189,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......@@ -1867,6 +1909,9 @@
],
"writeConcernError": {
"code": 91,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......
{
"runOn": [
{
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
]
}
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [],
"tests": [
{
"description": "commitTransaction does not retry error without RetryableWriteError label",
"clientOptions": {
"retryWrites": false
},
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"commitTransaction"
],
"errorCode": 11600,
"errorLabels": []
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "commitTransaction",
"object": "session0",
"result": {
"errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError"
]
}
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "commitTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": []
}
}
},
{
"description": "commitTransaction retries once with RetryableWriteError from server",
"clientOptions": {
"retryWrites": false
},
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"commitTransaction"
],
"errorCode": 112,
"errorLabels": [
"RetryableWriteError"
]
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "commitTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "commitTransaction",
"database_name": "admin"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": {
"w": "majority",
"wtimeout": 10000
}
},
"command_name": "commitTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
}
]
}
}
}
]
}
......@@ -57,6 +57,7 @@
"object": "session0",
"result": {
"errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
......@@ -207,6 +208,7 @@
"object": "session0",
"result": {
"errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
......@@ -353,7 +355,9 @@
"result": {
"errorCodeName": "Interrupted",
"errorLabelsOmit": [
"TransientTransactionError"
"RetryableWriteError",
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
}
}
......@@ -406,7 +410,7 @@
}
},
{
"description": "commitTransaction fails after WriteConcernError Interrupted",
"description": "commitTransaction is not retried after UnsatisfiableWriteConcern error",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
......@@ -417,8 +421,8 @@
"commitTransaction"
],
"writeConcernError": {
"code": 11601,
"errmsg": "operation was interrupted"
"code": 100,
"errmsg": "Not enough data-bearing nodes"
}
}
},
......@@ -452,7 +456,9 @@
"object": "session0",
"result": {
"errorLabelsOmit": [
"TransientTransactionError"
"RetryableWriteError",
"TransientTransactionError",
"UnknownTransactionCommitResult"
]
}
}
......@@ -629,6 +635,9 @@
"commitTransaction"
],
"errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -737,6 +746,9 @@
"commitTransaction"
],
"errorCode": 13436,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -845,6 +857,9 @@
"commitTransaction"
],
"errorCode": 13435,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -953,6 +968,9 @@
"commitTransaction"
],
"errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1061,6 +1079,9 @@
"commitTransaction"
],
"errorCode": 11600,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1169,6 +1190,9 @@
"commitTransaction"
],
"errorCode": 189,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1277,6 +1301,9 @@
"commitTransaction"
],
"errorCode": 91,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1385,6 +1412,9 @@
"commitTransaction"
],
"errorCode": 7,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1493,6 +1523,9 @@
"commitTransaction"
],
"errorCode": 6,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1601,6 +1634,9 @@
"commitTransaction"
],
"errorCode": 9001,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1709,6 +1745,9 @@
"commitTransaction"
],
"errorCode": 89,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false
}
},
......@@ -1818,6 +1857,9 @@
],
"writeConcernError": {
"code": 11600,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......@@ -1937,6 +1979,9 @@
],
"writeConcernError": {
"code": 11602,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......@@ -2056,6 +2101,9 @@
],
"writeConcernError": {
"code": 189,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......@@ -2175,6 +2223,9 @@
],
"writeConcernError": {
"code": 91,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down"
}
}
......
{
"runOn": [
{
"minServerVersion": "4.0",
"topology": [
"replicaset"
]
}
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [],
"tests": [
{
"description": "readConcern snapshot in startTransaction options",
"sessionOptions": {
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "majority"
}
}
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
}
}
}
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "commitTransaction",
"object": "session0"
},
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
}
}
}
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 2
}
},
"result": {
"insertedId": 2
}
},
{
"name": "abortTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
},
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "commitTransaction",
"database_name": "admin"
}
},
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 2
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "2"
},
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot",
"afterClusterTime": 42
},
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"abortTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "2"
},
"startTransaction": null,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "abortTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
}
]
}
}
}
]
}
......@@ -322,7 +322,7 @@
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": 1
......@@ -393,7 +393,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null
},
......@@ -438,7 +438,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot",
"level": "majority",
"afterClusterTime": 42
},
"writeConcern": null
......@@ -487,7 +487,7 @@
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "majority"
"level": "snapshot"
},
"writeConcern": {
"w": 1
......@@ -503,7 +503,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": "majority"
......@@ -535,7 +535,7 @@
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": "majority"
......@@ -579,7 +579,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null,
"maxTimeMS": null
......@@ -625,7 +625,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot",
"level": "majority",
"afterClusterTime": 42
},
"writeConcern": null,
......@@ -676,7 +676,7 @@
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": {
"w": "majority"
......@@ -747,7 +747,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
"level": "majority"
},
"writeConcern": null,
"maxTimeMS": null
......@@ -793,7 +793,7 @@
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot",
"level": "majority",
"afterClusterTime": 42
},
"writeConcern": null,
......@@ -993,172 +993,6 @@
}
}
},
{
"description": "readConcern snapshot in startTransaction options",
"sessionOptions": {
"session0": {
"defaultTransactionOptions": {
"readConcern": {
"level": "majority"
}
}
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
}
}
}
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "commitTransaction",
"object": "session0"
},
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"readConcern": {
"level": "snapshot"
}
}
}
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 2
}
},
"result": {
"insertedId": 2
}
},
{
"name": "abortTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot"
},
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "commitTransaction",
"database_name": "admin"
}
},
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 2
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "2"
},
"startTransaction": true,
"autocommit": false,
"readConcern": {
"level": "snapshot",
"afterClusterTime": 42
},
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"abortTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "2"
},
"startTransaction": null,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "abortTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
}
]
}
}
},
{
"description": "client writeConcern ignored for bulk",
"clientOptions": {
......
......@@ -116,7 +116,6 @@
"x": 1
}
},
"multi": false,
"upsert": true
}
],
......@@ -145,9 +144,7 @@
},
"u": {
"y": 1
},
"multi": false,
"upsert": false
}
}
],
"ordered": true,
......@@ -179,8 +176,7 @@
"z": 1
}
},
"multi": true,
"upsert": false
"multi": true
}
],
"ordered": true,
......@@ -346,7 +342,6 @@
"x": 1
}
},
"multi": false,
"upsert": true
}
],
......@@ -375,9 +370,7 @@
},
"u": {
"y": 1
},
"multi": false,
"upsert": false
}
}
],
"ordered": true,
......@@ -409,8 +402,7 @@
"z": 1
}
},
"multi": true,
"upsert": false
"multi": true
}
],
"ordered": true,
......
......@@ -877,7 +877,6 @@
"x": 1
}
},
"multi": false,
"upsert": true
}
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment