1467 lines
33 KiB
JSON
1467 lines
33 KiB
JSON
{
|
|
"description": "pin-mongos",
|
|
"schemaVersion": "1.9",
|
|
"runOnRequirements": [
|
|
{
|
|
"minServerVersion": "4.1.8",
|
|
"serverless": "forbid",
|
|
"topologies": [
|
|
"sharded",
|
|
"load-balanced"
|
|
]
|
|
}
|
|
],
|
|
"createEntities": [
|
|
{
|
|
"client": {
|
|
"id": "client0",
|
|
"useMultipleMongoses": true,
|
|
"observeEvents": [
|
|
"commandStartedEvent"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"database": {
|
|
"id": "database0",
|
|
"client": "client0",
|
|
"databaseName": "transaction-tests"
|
|
}
|
|
},
|
|
{
|
|
"collection": {
|
|
"id": "collection0",
|
|
"database": "database0",
|
|
"collectionName": "test"
|
|
}
|
|
},
|
|
{
|
|
"session": {
|
|
"id": "session0",
|
|
"client": "client0"
|
|
}
|
|
}
|
|
],
|
|
"initialData": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"tests": [
|
|
{
|
|
"description": "countDocuments",
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "distinct",
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "distinct",
|
|
"arguments": {
|
|
"fieldName": "_id",
|
|
"filter": {},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
1,
|
|
2
|
|
]
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "find",
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "find",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 2
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": [
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "insertOne",
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 3
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 4
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 4
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 5
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 5
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 6
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 6
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 7
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 7
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 8
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 8
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 9
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 9
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 10
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 10
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
},
|
|
{
|
|
"_id": 3
|
|
},
|
|
{
|
|
"_id": 4
|
|
},
|
|
{
|
|
"_id": 5
|
|
},
|
|
{
|
|
"_id": 6
|
|
},
|
|
{
|
|
"_id": 7
|
|
},
|
|
{
|
|
"_id": 8
|
|
},
|
|
{
|
|
"_id": 9
|
|
},
|
|
{
|
|
"_id": 10
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "mixed read write operations",
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 3
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "countDocuments",
|
|
"arguments": {
|
|
"filter": {
|
|
"_id": 3
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": 1
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 4
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 4
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 5
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 5
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 6
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 6
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"document": {
|
|
"_id": 7
|
|
},
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 7
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
},
|
|
{
|
|
"_id": 3
|
|
},
|
|
{
|
|
"_id": 4
|
|
},
|
|
{
|
|
"_id": 5
|
|
},
|
|
{
|
|
"_id": 6
|
|
},
|
|
{
|
|
"_id": 7
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "multiple commits",
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertMany",
|
|
"arguments": {
|
|
"documents": [
|
|
{
|
|
"_id": 3
|
|
},
|
|
{
|
|
"_id": 4
|
|
}
|
|
],
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedIds": {
|
|
"$$unsetOrMatches": {
|
|
"0": 3,
|
|
"1": 4
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "assertSessionPinned",
|
|
"arguments": {
|
|
"session": "session0"
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "assertSessionPinned",
|
|
"arguments": {
|
|
"session": "session0"
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "assertSessionPinned",
|
|
"arguments": {
|
|
"session": "session0"
|
|
}
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
},
|
|
{
|
|
"_id": 3
|
|
},
|
|
{
|
|
"_id": 4
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "remain pinned after non-transient error on commit",
|
|
"runOnRequirements": [
|
|
{
|
|
"topologies": [
|
|
"sharded"
|
|
]
|
|
}
|
|
],
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertMany",
|
|
"arguments": {
|
|
"documents": [
|
|
{
|
|
"_id": 3
|
|
},
|
|
{
|
|
"_id": 4
|
|
}
|
|
],
|
|
"session": "session0"
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedIds": {
|
|
"$$unsetOrMatches": {
|
|
"0": 3,
|
|
"1": 4
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "assertSessionPinned",
|
|
"arguments": {
|
|
"session": "session0"
|
|
}
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "targetedFailPoint",
|
|
"arguments": {
|
|
"session": "session0",
|
|
"failPoint": {
|
|
"configureFailPoint": "failCommand",
|
|
"mode": {
|
|
"times": 1
|
|
},
|
|
"data": {
|
|
"failCommands": [
|
|
"commitTransaction"
|
|
],
|
|
"errorCode": 51
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction",
|
|
"expectError": {
|
|
"errorLabelsOmit": [
|
|
"TransientTransactionError"
|
|
],
|
|
"errorCode": 51
|
|
}
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "assertSessionPinned",
|
|
"arguments": {
|
|
"session": "session0"
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "commitTransaction"
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "assertSessionPinned",
|
|
"arguments": {
|
|
"session": "session0"
|
|
}
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
},
|
|
{
|
|
"_id": 3
|
|
},
|
|
{
|
|
"_id": 4
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "unpin after transient error within a transaction",
|
|
"runOnRequirements": [
|
|
{
|
|
"topologies": [
|
|
"sharded"
|
|
]
|
|
}
|
|
],
|
|
"operations": [
|
|
{
|
|
"object": "session0",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"session": "session0",
|
|
"document": {
|
|
"_id": 3
|
|
}
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 3
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "targetedFailPoint",
|
|
"arguments": {
|
|
"session": "session0",
|
|
"failPoint": {
|
|
"configureFailPoint": "failCommand",
|
|
"mode": {
|
|
"times": 1
|
|
},
|
|
"data": {
|
|
"failCommands": [
|
|
"insert"
|
|
],
|
|
"closeConnection": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection0",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"session": "session0",
|
|
"document": {
|
|
"_id": 4
|
|
}
|
|
},
|
|
"expectError": {
|
|
"errorLabelsContain": [
|
|
"TransientTransactionError"
|
|
],
|
|
"errorLabelsOmit": [
|
|
"UnknownTransactionCommitResult"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"object": "session0",
|
|
"name": "abortTransaction"
|
|
}
|
|
],
|
|
"expectEvents": [
|
|
{
|
|
"client": "client0",
|
|
"events": [
|
|
{
|
|
"commandStartedEvent": {
|
|
"command": {
|
|
"insert": "test",
|
|
"documents": [
|
|
{
|
|
"_id": 3
|
|
}
|
|
],
|
|
"ordered": true,
|
|
"readConcern": {
|
|
"$$exists": false
|
|
},
|
|
"lsid": {
|
|
"$$sessionLsid": "session0"
|
|
},
|
|
"txnNumber": {
|
|
"$numberLong": "1"
|
|
},
|
|
"startTransaction": true,
|
|
"autocommit": false,
|
|
"writeConcern": {
|
|
"$$exists": false
|
|
}
|
|
},
|
|
"commandName": "insert",
|
|
"databaseName": "transaction-tests"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"command": {
|
|
"insert": "test",
|
|
"documents": [
|
|
{
|
|
"_id": 4
|
|
}
|
|
],
|
|
"ordered": true,
|
|
"readConcern": {
|
|
"$$exists": false
|
|
},
|
|
"lsid": {
|
|
"$$sessionLsid": "session0"
|
|
},
|
|
"txnNumber": {
|
|
"$numberLong": "1"
|
|
},
|
|
"startTransaction": {
|
|
"$$exists": false
|
|
},
|
|
"autocommit": false,
|
|
"writeConcern": {
|
|
"$$exists": false
|
|
}
|
|
},
|
|
"commandName": "insert",
|
|
"databaseName": "transaction-tests"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"command": {
|
|
"abortTransaction": 1,
|
|
"lsid": {
|
|
"$$sessionLsid": "session0"
|
|
},
|
|
"txnNumber": {
|
|
"$numberLong": "1"
|
|
},
|
|
"startTransaction": {
|
|
"$$exists": false
|
|
},
|
|
"autocommit": false,
|
|
"writeConcern": {
|
|
"$$exists": false
|
|
},
|
|
"recoveryToken": {
|
|
"$$exists": true
|
|
}
|
|
},
|
|
"commandName": "abortTransaction",
|
|
"databaseName": "admin"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "unpin after transient error within a transaction and commit",
|
|
"runOnRequirements": [
|
|
{
|
|
"topologies": [
|
|
"sharded"
|
|
]
|
|
}
|
|
],
|
|
"operations": [
|
|
{
|
|
"object": "testRunner",
|
|
"name": "createEntities",
|
|
"arguments": {
|
|
"entities": [
|
|
{
|
|
"client": {
|
|
"id": "client1",
|
|
"useMultipleMongoses": true,
|
|
"uriOptions": {
|
|
"heartbeatFrequencyMS": 30000,
|
|
"appName": "transactionsClient"
|
|
},
|
|
"observeEvents": [
|
|
"commandStartedEvent"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"database": {
|
|
"id": "database1",
|
|
"client": "client1",
|
|
"databaseName": "transaction-tests"
|
|
}
|
|
},
|
|
{
|
|
"collection": {
|
|
"id": "collection1",
|
|
"database": "database1",
|
|
"collectionName": "test"
|
|
}
|
|
},
|
|
{
|
|
"session": {
|
|
"id": "session1",
|
|
"client": "client1"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"object": "session1",
|
|
"name": "startTransaction"
|
|
},
|
|
{
|
|
"object": "collection1",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"session": "session1",
|
|
"document": {
|
|
"_id": 3
|
|
}
|
|
},
|
|
"expectResult": {
|
|
"$$unsetOrMatches": {
|
|
"insertedId": {
|
|
"$$unsetOrMatches": 3
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "testRunner",
|
|
"name": "targetedFailPoint",
|
|
"arguments": {
|
|
"session": "session1",
|
|
"failPoint": {
|
|
"configureFailPoint": "failCommand",
|
|
"mode": {
|
|
"times": 7
|
|
},
|
|
"data": {
|
|
"failCommands": [
|
|
"insert",
|
|
"isMaster",
|
|
"hello"
|
|
],
|
|
"closeConnection": true,
|
|
"appName": "transactionsClient"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"object": "collection1",
|
|
"name": "insertOne",
|
|
"arguments": {
|
|
"session": "session1",
|
|
"document": {
|
|
"_id": 4
|
|
}
|
|
},
|
|
"expectError": {
|
|
"errorLabelsContain": [
|
|
"TransientTransactionError"
|
|
],
|
|
"errorLabelsOmit": [
|
|
"UnknownTransactionCommitResult"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"object": "session1",
|
|
"name": "commitTransaction",
|
|
"expectError": {
|
|
"errorLabelsContain": [
|
|
"TransientTransactionError"
|
|
],
|
|
"errorLabelsOmit": [
|
|
"UnknownTransactionCommitResult"
|
|
],
|
|
"errorCodeName": "NoSuchTransaction"
|
|
}
|
|
}
|
|
],
|
|
"expectEvents": [
|
|
{
|
|
"client": "client1",
|
|
"events": [
|
|
{
|
|
"commandStartedEvent": {
|
|
"command": {
|
|
"insert": "test",
|
|
"documents": [
|
|
{
|
|
"_id": 3
|
|
}
|
|
],
|
|
"ordered": true,
|
|
"readConcern": {
|
|
"$$exists": false
|
|
},
|
|
"lsid": {
|
|
"$$sessionLsid": "session1"
|
|
},
|
|
"txnNumber": {
|
|
"$numberLong": "1"
|
|
},
|
|
"startTransaction": true,
|
|
"autocommit": false,
|
|
"writeConcern": {
|
|
"$$exists": false
|
|
}
|
|
},
|
|
"commandName": "insert",
|
|
"databaseName": "transaction-tests"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"command": {
|
|
"insert": "test",
|
|
"documents": [
|
|
{
|
|
"_id": 4
|
|
}
|
|
],
|
|
"ordered": true,
|
|
"readConcern": {
|
|
"$$exists": false
|
|
},
|
|
"lsid": {
|
|
"$$sessionLsid": "session1"
|
|
},
|
|
"txnNumber": {
|
|
"$numberLong": "1"
|
|
},
|
|
"startTransaction": {
|
|
"$$exists": false
|
|
},
|
|
"autocommit": false,
|
|
"writeConcern": {
|
|
"$$exists": false
|
|
}
|
|
},
|
|
"commandName": "insert",
|
|
"databaseName": "transaction-tests"
|
|
}
|
|
},
|
|
{
|
|
"commandStartedEvent": {
|
|
"command": {
|
|
"commitTransaction": 1,
|
|
"lsid": {
|
|
"$$sessionLsid": "session1"
|
|
},
|
|
"txnNumber": {
|
|
"$numberLong": "1"
|
|
},
|
|
"startTransaction": {
|
|
"$$exists": false
|
|
},
|
|
"autocommit": false,
|
|
"writeConcern": {
|
|
"$$exists": false
|
|
},
|
|
"recoveryToken": {
|
|
"$$exists": true
|
|
}
|
|
},
|
|
"commandName": "commitTransaction",
|
|
"databaseName": "admin"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"outcome": [
|
|
{
|
|
"collectionName": "test",
|
|
"databaseName": "transaction-tests",
|
|
"documents": [
|
|
{
|
|
"_id": 1
|
|
},
|
|
{
|
|
"_id": 2
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|