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 ...@@ -185,9 +185,6 @@ final class Context
$clientOptions = isset($test->clientOptions) ? (array) $test->clientOptions : []; $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)) { if (isset($test->outcome->collection->name)) {
$o->outcomeCollectionName = $test->outcome->collection->name; $o->outcomeCollectionName = $test->outcome->collection->name;
} }
......
...@@ -126,7 +126,7 @@ final class ResultExpectation ...@@ -126,7 +126,7 @@ final class ResultExpectation
public static function fromRetryableWrites(stdClass $outcome, $defaultAssertionType) 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; $assertionType = $outcome->result === null ? self::ASSERT_NULL : $defaultAssertionType;
$expectedValue = $outcome->result; $expectedValue = $outcome->result;
} else { } 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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"update" "update"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -117,7 +120,10 @@ ...@@ -117,7 +120,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -186,6 +192,81 @@ ...@@ -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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"delete" "delete"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -73,7 +76,10 @@ ...@@ -73,7 +76,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -98,6 +104,49 @@ ...@@ -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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"findAndModify" "findAndModify"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -79,7 +82,10 @@ ...@@ -79,7 +82,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -110,6 +116,54 @@ ...@@ -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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"findAndModify" "findAndModify"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -83,7 +86,10 @@ ...@@ -83,7 +86,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -118,6 +124,54 @@ ...@@ -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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"findAndModify" "findAndModify"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -84,7 +87,10 @@ ...@@ -84,7 +87,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -120,6 +126,55 @@ ...@@ -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 @@ ...@@ -31,7 +31,10 @@
"failCommands": [ "failCommands": [
"insert" "insert"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -90,7 +93,10 @@ ...@@ -90,7 +93,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -136,6 +142,55 @@ ...@@ -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 @@ ...@@ -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", "description": "InsertOne succeeds after NotMaster",
"failPoint": { "failPoint": {
...@@ -81,6 +128,9 @@ ...@@ -81,6 +128,9 @@
"insert" "insert"
], ],
"errorCode": 10107, "errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -127,6 +177,9 @@ ...@@ -127,6 +177,9 @@
"insert" "insert"
], ],
"errorCode": 13436, "errorCode": 13436,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -173,6 +226,9 @@ ...@@ -173,6 +226,9 @@
"insert" "insert"
], ],
"errorCode": 13435, "errorCode": 13435,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -208,7 +264,7 @@ ...@@ -208,7 +264,7 @@
} }
}, },
{ {
"description": "InsertOne succeeds after InterruptedDueToStepDown", "description": "InsertOne succeeds after InterruptedDueToReplStateChange",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -219,6 +275,9 @@ ...@@ -219,6 +275,9 @@
"insert" "insert"
], ],
"errorCode": 11602, "errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -265,6 +324,9 @@ ...@@ -265,6 +324,9 @@
"insert" "insert"
], ],
"errorCode": 11600, "errorCode": 11600,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -311,6 +373,9 @@ ...@@ -311,6 +373,9 @@
"insert" "insert"
], ],
"errorCode": 189, "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -357,6 +422,9 @@ ...@@ -357,6 +422,9 @@
"insert" "insert"
], ],
"errorCode": 91, "errorCode": 91,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -403,6 +471,9 @@ ...@@ -403,6 +471,9 @@
"insert" "insert"
], ],
"errorCode": 7, "errorCode": 7,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -449,6 +520,9 @@ ...@@ -449,6 +520,9 @@
"insert" "insert"
], ],
"errorCode": 6, "errorCode": 6,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -495,6 +569,9 @@ ...@@ -495,6 +569,9 @@
"insert" "insert"
], ],
"errorCode": 9001, "errorCode": 9001,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -541,6 +618,58 @@ ...@@ -541,6 +618,58 @@
"insert" "insert"
], ],
"errorCode": 89, "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 "closeConnection": false
} }
}, },
...@@ -601,6 +730,11 @@ ...@@ -601,6 +730,11 @@
}, },
"outcome": { "outcome": {
"error": true, "error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": { "collection": {
"data": [ "data": [
{ {
...@@ -628,7 +762,10 @@ ...@@ -628,7 +762,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 11600, "code": 11600,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -664,7 +801,7 @@ ...@@ -664,7 +801,7 @@
} }
}, },
{ {
"description": "InsertOne succeeds after WriteConcernError InterruptedDueToStepDown", "description": "InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -676,7 +813,10 @@ ...@@ -676,7 +813,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 11602, "code": 11602,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -724,7 +864,10 @@ ...@@ -724,7 +864,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 189, "code": 189,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -772,7 +915,10 @@ ...@@ -772,7 +915,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -835,6 +981,11 @@ ...@@ -835,6 +981,11 @@
}, },
"outcome": { "outcome": {
"error": true, "error": true,
"result": {
"errorLabelsContain": [
"RetryableWriteError"
]
},
"collection": { "collection": {
"data": [ "data": [
{ {
...@@ -881,6 +1032,11 @@ ...@@ -881,6 +1032,11 @@
}, },
"outcome": { "outcome": {
"error": true, "error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": { "collection": {
"data": [ "data": [
{ {
...@@ -931,6 +1087,11 @@ ...@@ -931,6 +1087,11 @@
}, },
"outcome": { "outcome": {
"error": true, "error": true,
"result": {
"errorLabelsOmit": [
"RetryableWriteError"
]
},
"collection": { "collection": {
"data": [ "data": [
{ {
...@@ -948,6 +1109,50 @@ ...@@ -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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"update" "update"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -83,7 +86,10 @@ ...@@ -83,7 +86,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -118,6 +124,53 @@ ...@@ -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 @@ ...@@ -35,7 +35,10 @@
"failCommands": [ "failCommands": [
"update" "update"
], ],
"errorCode": 189 "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operation": { "operation": {
...@@ -84,7 +87,10 @@ ...@@ -84,7 +87,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -120,6 +126,54 @@ ...@@ -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 @@ ...@@ -235,7 +235,8 @@
"errorLabelsOmit": [ "errorLabelsOmit": [
"TransientTransactionError", "TransientTransactionError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
] ],
"errorContains": "E11000"
} }
} }
], ],
......
...@@ -304,6 +304,9 @@ ...@@ -304,6 +304,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 10107, "errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
......
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
"session0": { "session0": {
"defaultTransactionOptions": { "defaultTransactionOptions": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": 1 "w": 1
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null "writeConcern": null
}, },
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
}, },
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": 1 "w": 1
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null "writeConcern": null
}, },
...@@ -380,7 +380,7 @@ ...@@ -380,7 +380,7 @@
"session0": { "session0": {
"defaultTransactionOptions": { "defaultTransactionOptions": {
"readConcern": { "readConcern": {
"level": "majority" "level": "snapshot"
}, },
"writeConcern": { "writeConcern": {
"w": "majority" "w": "majority"
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
}, },
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": 1 "w": 1
...@@ -439,7 +439,7 @@ ...@@ -439,7 +439,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null "writeConcern": null
}, },
...@@ -481,7 +481,7 @@ ...@@ -481,7 +481,7 @@
"description": "withTransaction explicit transaction options override client options", "description": "withTransaction explicit transaction options override client options",
"useMultipleMongoses": true, "useMultipleMongoses": true,
"clientOptions": { "clientOptions": {
"readConcernLevel": "majority", "readConcernLevel": "local",
"w": "majority" "w": "majority"
}, },
"operations": [ "operations": [
...@@ -508,7 +508,7 @@ ...@@ -508,7 +508,7 @@
}, },
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": 1 "w": 1
...@@ -535,7 +535,7 @@ ...@@ -535,7 +535,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null "writeConcern": null
}, },
......
...@@ -458,7 +458,8 @@ ...@@ -458,7 +458,8 @@
"errorLabelsOmit": [ "errorLabelsOmit": [
"TransientTransactionError", "TransientTransactionError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
] ],
"errorContains": "E11000"
} }
}, },
{ {
......
...@@ -304,9 +304,7 @@ ...@@ -304,9 +304,7 @@
"$set": { "$set": {
"x": 1 "x": 1
} }
}, }
"multi": false,
"upsert": false
}, },
{ {
"q": { "q": {
...@@ -317,7 +315,6 @@ ...@@ -317,7 +315,6 @@
"x": 2 "x": 2
} }
}, },
"multi": false,
"upsert": true "upsert": true
} }
], ],
...@@ -379,9 +376,7 @@ ...@@ -379,9 +376,7 @@
}, },
"u": { "u": {
"y": 1 "y": 1
}, }
"multi": false,
"upsert": false
}, },
{ {
"q": { "q": {
...@@ -389,9 +384,7 @@ ...@@ -389,9 +384,7 @@
}, },
"u": { "u": {
"y": 2 "y": 2
}, }
"multi": false,
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
...@@ -454,8 +447,7 @@ ...@@ -454,8 +447,7 @@
"z": 1 "z": 1
} }
}, },
"multi": true, "multi": true
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
......
...@@ -40,8 +40,7 @@ ...@@ -40,8 +40,7 @@
"$inc": { "$inc": {
"count": 1 "count": 1
} }
}, }
"upsert": false
}, },
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
...@@ -65,8 +64,7 @@ ...@@ -65,8 +64,7 @@
"$inc": { "$inc": {
"count": 1 "count": 1
} }
}, }
"upsert": false
}, },
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
...@@ -93,9 +91,7 @@ ...@@ -93,9 +91,7 @@
"$inc": { "$inc": {
"count": 1 "count": 1
} }
}, }
"multi": false,
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
...@@ -123,9 +119,7 @@ ...@@ -123,9 +119,7 @@
"$inc": { "$inc": {
"count": 1 "count": 1
} }
}, }
"multi": false,
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
...@@ -212,8 +206,7 @@ ...@@ -212,8 +206,7 @@
"$inc": { "$inc": {
"count": 1 "count": 1
} }
}, }
"upsert": false
}, },
"result": { "result": {
"matchedCount": 1, "matchedCount": 1,
...@@ -260,9 +253,7 @@ ...@@ -260,9 +253,7 @@
"$inc": { "$inc": {
"count": 1 "count": 1
} }
}, }
"multi": false,
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
"errorLabelsOmit": [ "errorLabelsOmit": [
"TransientTransactionError", "TransientTransactionError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
] ],
"errorContains": "E11000"
} }
}, },
{ {
...@@ -407,6 +408,7 @@ ...@@ -407,6 +408,7 @@
"TransientTransactionError" "TransientTransactionError"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
] ]
} }
...@@ -460,7 +462,7 @@ ...@@ -460,7 +462,7 @@
} }
}, },
{ {
"description": "add transient label to connection errors", "description": "add TransientTransactionError label to connection errors",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -662,7 +664,7 @@ ...@@ -662,7 +664,7 @@
} }
}, },
{ {
"description": "add unknown commit label to connection errors", "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -698,6 +700,7 @@ ...@@ -698,6 +700,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsContain": [ "errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
...@@ -800,7 +803,7 @@ ...@@ -800,7 +803,7 @@
} }
}, },
{ {
"description": "add unknown commit label to retryable commit errors", "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -810,7 +813,10 @@ ...@@ -810,7 +813,10 @@
"failCommands": [ "failCommands": [
"commitTransaction" "commitTransaction"
], ],
"errorCode": 11602 "errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
]
} }
}, },
"operations": [ "operations": [
...@@ -836,6 +842,7 @@ ...@@ -836,6 +842,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsContain": [ "errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
...@@ -938,7 +945,7 @@ ...@@ -938,7 +945,7 @@
} }
}, },
{ {
"description": "add unknown commit label to writeConcernError ShutdownInProgress", "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -950,7 +957,10 @@ ...@@ -950,7 +957,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
}, },
...@@ -984,6 +994,7 @@ ...@@ -984,6 +994,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsContain": [ "errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
...@@ -1088,7 +1099,7 @@ ...@@ -1088,7 +1099,7 @@
} }
}, },
{ {
"description": "add unknown commit label to writeConcernError WriteConcernFailed", "description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1137,6 +1148,7 @@ ...@@ -1137,6 +1148,7 @@
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError" "TransientTransactionError"
] ]
} }
...@@ -1219,7 +1231,7 @@ ...@@ -1219,7 +1231,7 @@
} }
}, },
{ {
"description": "add unknown commit label to writeConcernError WriteConcernFailed with wtimeout", "description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1272,6 +1284,7 @@ ...@@ -1272,6 +1284,7 @@
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError" "TransientTransactionError"
] ]
} }
...@@ -1354,7 +1367,7 @@ ...@@ -1354,7 +1367,7 @@
} }
}, },
{ {
"description": "omit unknown commit label to writeConcernError UnsatisfiableWriteConcern", "description": "omit UnknownTransactionCommitResult label from writeConcernError UnsatisfiableWriteConcern",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1400,6 +1413,7 @@ ...@@ -1400,6 +1413,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError", "TransientTransactionError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
] ]
...@@ -1460,7 +1474,7 @@ ...@@ -1460,7 +1474,7 @@
} }
}, },
{ {
"description": "omit unknown commit label to writeConcernError UnknownReplWriteConcern", "description": "omit UnknownTransactionCommitResult label from writeConcernError UnknownReplWriteConcern",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1506,6 +1520,7 @@ ...@@ -1506,6 +1520,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteConcern",
"TransientTransactionError", "TransientTransactionError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
] ]
...@@ -1566,7 +1581,7 @@ ...@@ -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": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1613,6 +1628,7 @@ ...@@ -1613,6 +1628,7 @@
}, },
"result": { "result": {
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"UnknownTransactionCommitResult", "UnknownTransactionCommitResult",
"TransientTransactionError" "TransientTransactionError"
] ]
...@@ -1695,7 +1711,7 @@ ...@@ -1695,7 +1711,7 @@
} }
}, },
{ {
"description": "add unknown commit label to MaxTimeMSExpired", "description": "add UnknownTransactionCommitResult label to MaxTimeMSExpired",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1742,6 +1758,7 @@ ...@@ -1742,6 +1758,7 @@
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError" "TransientTransactionError"
] ]
} }
...@@ -1826,7 +1843,7 @@ ...@@ -1826,7 +1843,7 @@
} }
}, },
{ {
"description": "add unknown commit label to writeConcernError MaxTimeMSExpired", "description": "add UnknownTransactionCommitResult label to writeConcernError MaxTimeMSExpired",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -1876,6 +1893,7 @@ ...@@ -1876,6 +1893,7 @@
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
"RetryableWriteError",
"TransientTransactionError" "TransientTransactionError"
] ]
} }
......
...@@ -181,7 +181,10 @@ ...@@ -181,7 +181,10 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
} }
} }
} }
......
...@@ -875,7 +875,7 @@ ...@@ -875,7 +875,7 @@
"failCommands": [ "failCommands": [
"commitTransaction" "commitTransaction"
], ],
"errorCode": 50 "errorCode": 51
} }
} }
} }
...@@ -887,7 +887,7 @@ ...@@ -887,7 +887,7 @@
"errorLabelsOmit": [ "errorLabelsOmit": [
"TransientTransactionError" "TransientTransactionError"
], ],
"errorCode": 50 "errorCode": 51
} }
}, },
{ {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
} }
} }
} }
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
"cursor": {}, "cursor": {},
"lsid": "session0", "lsid": "session0",
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"txnNumber": { "txnNumber": {
"$numberLong": "1" "$numberLong": "1"
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
} }
} }
} }
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
"batchSize": 3, "batchSize": 3,
"lsid": "session0", "lsid": "session0",
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"txnNumber": { "txnNumber": {
"$numberLong": "1" "$numberLong": "1"
...@@ -389,7 +389,7 @@ ...@@ -389,7 +389,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
} }
} }
} }
...@@ -484,7 +484,7 @@ ...@@ -484,7 +484,7 @@
}, },
"lsid": "session0", "lsid": "session0",
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"txnNumber": { "txnNumber": {
"$numberLong": "1" "$numberLong": "1"
...@@ -608,7 +608,7 @@ ...@@ -608,7 +608,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
} }
} }
} }
...@@ -664,7 +664,7 @@ ...@@ -664,7 +664,7 @@
"key": "_id", "key": "_id",
"lsid": "session0", "lsid": "session0",
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"txnNumber": { "txnNumber": {
"$numberLong": "1" "$numberLong": "1"
...@@ -741,7 +741,7 @@ ...@@ -741,7 +741,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
} }
} }
} }
...@@ -780,7 +780,7 @@ ...@@ -780,7 +780,7 @@
"find": "test", "find": "test",
"lsid": "session0", "lsid": "session0",
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"txnNumber": { "txnNumber": {
"$numberLong": "1" "$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 @@ ...@@ -413,6 +413,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 10107, "errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -514,6 +517,9 @@ ...@@ -514,6 +517,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 13436, "errorCode": 13436,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -615,6 +621,9 @@ ...@@ -615,6 +621,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 13435, "errorCode": 13435,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -716,6 +725,9 @@ ...@@ -716,6 +725,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 11602, "errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -817,6 +829,9 @@ ...@@ -817,6 +829,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 11600, "errorCode": 11600,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -918,6 +933,9 @@ ...@@ -918,6 +933,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 189, "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1019,6 +1037,9 @@ ...@@ -1019,6 +1037,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 91, "errorCode": 91,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1120,6 +1141,9 @@ ...@@ -1120,6 +1141,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 7, "errorCode": 7,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1221,6 +1245,9 @@ ...@@ -1221,6 +1245,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 6, "errorCode": 6,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1322,6 +1349,9 @@ ...@@ -1322,6 +1349,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 9001, "errorCode": 9001,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1423,6 +1453,9 @@ ...@@ -1423,6 +1453,9 @@
"abortTransaction" "abortTransaction"
], ],
"errorCode": 89, "errorCode": 89,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1525,6 +1558,9 @@ ...@@ -1525,6 +1558,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 11600, "code": 11600,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down"
} }
} }
...@@ -1639,6 +1675,9 @@ ...@@ -1639,6 +1675,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 11602, "code": 11602,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down"
} }
} }
...@@ -1753,6 +1792,9 @@ ...@@ -1753,6 +1792,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 189, "code": 189,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down"
} }
} }
...@@ -1867,6 +1909,9 @@ ...@@ -1867,6 +1909,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "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 @@ ...@@ -57,6 +57,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsContain": [ "errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
...@@ -207,6 +208,7 @@ ...@@ -207,6 +208,7 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsContain": [ "errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult" "UnknownTransactionCommitResult"
], ],
"errorLabelsOmit": [ "errorLabelsOmit": [
...@@ -353,7 +355,9 @@ ...@@ -353,7 +355,9 @@
"result": { "result": {
"errorCodeName": "Interrupted", "errorCodeName": "Interrupted",
"errorLabelsOmit": [ "errorLabelsOmit": [
"TransientTransactionError" "RetryableWriteError",
"TransientTransactionError",
"UnknownTransactionCommitResult"
] ]
} }
} }
...@@ -406,7 +410,7 @@ ...@@ -406,7 +410,7 @@
} }
}, },
{ {
"description": "commitTransaction fails after WriteConcernError Interrupted", "description": "commitTransaction is not retried after UnsatisfiableWriteConcern error",
"failPoint": { "failPoint": {
"configureFailPoint": "failCommand", "configureFailPoint": "failCommand",
"mode": { "mode": {
...@@ -417,8 +421,8 @@ ...@@ -417,8 +421,8 @@
"commitTransaction" "commitTransaction"
], ],
"writeConcernError": { "writeConcernError": {
"code": 11601, "code": 100,
"errmsg": "operation was interrupted" "errmsg": "Not enough data-bearing nodes"
} }
} }
}, },
...@@ -452,7 +456,9 @@ ...@@ -452,7 +456,9 @@
"object": "session0", "object": "session0",
"result": { "result": {
"errorLabelsOmit": [ "errorLabelsOmit": [
"TransientTransactionError" "RetryableWriteError",
"TransientTransactionError",
"UnknownTransactionCommitResult"
] ]
} }
} }
...@@ -629,6 +635,9 @@ ...@@ -629,6 +635,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 10107, "errorCode": 10107,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -737,6 +746,9 @@ ...@@ -737,6 +746,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 13436, "errorCode": 13436,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -845,6 +857,9 @@ ...@@ -845,6 +857,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 13435, "errorCode": 13435,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -953,6 +968,9 @@ ...@@ -953,6 +968,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 11602, "errorCode": 11602,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1061,6 +1079,9 @@ ...@@ -1061,6 +1079,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 11600, "errorCode": 11600,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1169,6 +1190,9 @@ ...@@ -1169,6 +1190,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 189, "errorCode": 189,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1277,6 +1301,9 @@ ...@@ -1277,6 +1301,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 91, "errorCode": 91,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1385,6 +1412,9 @@ ...@@ -1385,6 +1412,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 7, "errorCode": 7,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1493,6 +1523,9 @@ ...@@ -1493,6 +1523,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 6, "errorCode": 6,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1601,6 +1634,9 @@ ...@@ -1601,6 +1634,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 9001, "errorCode": 9001,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1709,6 +1745,9 @@ ...@@ -1709,6 +1745,9 @@
"commitTransaction" "commitTransaction"
], ],
"errorCode": 89, "errorCode": 89,
"errorLabels": [
"RetryableWriteError"
],
"closeConnection": false "closeConnection": false
} }
}, },
...@@ -1818,6 +1857,9 @@ ...@@ -1818,6 +1857,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 11600, "code": 11600,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down"
} }
} }
...@@ -1937,6 +1979,9 @@ ...@@ -1937,6 +1979,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 11602, "code": 11602,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down"
} }
} }
...@@ -2056,6 +2101,9 @@ ...@@ -2056,6 +2101,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 189, "code": 189,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "errmsg": "Replication is being shut down"
} }
} }
...@@ -2175,6 +2223,9 @@ ...@@ -2175,6 +2223,9 @@
], ],
"writeConcernError": { "writeConcernError": {
"code": 91, "code": 91,
"errorLabels": [
"RetryableWriteError"
],
"errmsg": "Replication is being shut down" "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 @@ ...@@ -322,7 +322,7 @@
"session0": { "session0": {
"defaultTransactionOptions": { "defaultTransactionOptions": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": 1 "w": 1
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null "writeConcern": null
}, },
...@@ -438,7 +438,7 @@ ...@@ -438,7 +438,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot", "level": "majority",
"afterClusterTime": 42 "afterClusterTime": 42
}, },
"writeConcern": null "writeConcern": null
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
"session0": { "session0": {
"defaultTransactionOptions": { "defaultTransactionOptions": {
"readConcern": { "readConcern": {
"level": "majority" "level": "snapshot"
}, },
"writeConcern": { "writeConcern": {
"w": 1 "w": 1
...@@ -503,7 +503,7 @@ ...@@ -503,7 +503,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": "majority" "w": "majority"
...@@ -535,7 +535,7 @@ ...@@ -535,7 +535,7 @@
"arguments": { "arguments": {
"options": { "options": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": "majority" "w": "majority"
...@@ -579,7 +579,7 @@ ...@@ -579,7 +579,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null, "writeConcern": null,
"maxTimeMS": null "maxTimeMS": null
...@@ -625,7 +625,7 @@ ...@@ -625,7 +625,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot", "level": "majority",
"afterClusterTime": 42 "afterClusterTime": 42
}, },
"writeConcern": null, "writeConcern": null,
...@@ -676,7 +676,7 @@ ...@@ -676,7 +676,7 @@
"session0": { "session0": {
"defaultTransactionOptions": { "defaultTransactionOptions": {
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": { "writeConcern": {
"w": "majority" "w": "majority"
...@@ -747,7 +747,7 @@ ...@@ -747,7 +747,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot" "level": "majority"
}, },
"writeConcern": null, "writeConcern": null,
"maxTimeMS": null "maxTimeMS": null
...@@ -793,7 +793,7 @@ ...@@ -793,7 +793,7 @@
"startTransaction": true, "startTransaction": true,
"autocommit": false, "autocommit": false,
"readConcern": { "readConcern": {
"level": "snapshot", "level": "majority",
"afterClusterTime": 42 "afterClusterTime": 42
}, },
"writeConcern": null, "writeConcern": null,
...@@ -993,172 +993,6 @@ ...@@ -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", "description": "client writeConcern ignored for bulk",
"clientOptions": { "clientOptions": {
......
...@@ -116,7 +116,6 @@ ...@@ -116,7 +116,6 @@
"x": 1 "x": 1
} }
}, },
"multi": false,
"upsert": true "upsert": true
} }
], ],
...@@ -145,9 +144,7 @@ ...@@ -145,9 +144,7 @@
}, },
"u": { "u": {
"y": 1 "y": 1
}, }
"multi": false,
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
...@@ -179,8 +176,7 @@ ...@@ -179,8 +176,7 @@
"z": 1 "z": 1
} }
}, },
"multi": true, "multi": true
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
...@@ -346,7 +342,6 @@ ...@@ -346,7 +342,6 @@
"x": 1 "x": 1
} }
}, },
"multi": false,
"upsert": true "upsert": true
} }
], ],
...@@ -375,9 +370,7 @@ ...@@ -375,9 +370,7 @@
}, },
"u": { "u": {
"y": 1 "y": 1
}, }
"multi": false,
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
...@@ -409,8 +402,7 @@ ...@@ -409,8 +402,7 @@
"z": 1 "z": 1
} }
}, },
"multi": true, "multi": true
"upsert": false
} }
], ],
"ordered": true, "ordered": true,
......
...@@ -877,7 +877,6 @@ ...@@ -877,7 +877,6 @@
"x": 1 "x": 1
} }
}, },
"multi": false,
"upsert": true "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