mongo-python-driver/test/transactions/findOneAndDelete.json
Shane Harvey a886922157 PYTHON-1684 Support sharded transactions recovery token (#406)
Transient errors inside transaction unpins the session.
Add brief docs about sharded transactions and add 3.9 changelog.
Tests changes:
Add spec tests for sharded transaction recoveryToken.
Speed up txn tests by reducing SDAM waiting time after a network error.
Remove outdated test workaround for killAllSessions.
2019-02-27 13:28:06 -08:00

212 lines
4.9 KiB
JSON

{
"topology": [
"replicaset",
"sharded"
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [
{
"_id": 1
},
{
"_id": 2
},
{
"_id": 3
}
],
"tests": [
{
"description": "findOneAndDelete",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "findOneAndDelete",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 3
}
},
"result": {
"_id": 3
}
},
{
"name": "findOneAndDelete",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 4
}
},
"result": null
},
{
"name": "commitTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "test",
"query": {
"_id": 3
},
"remove": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "findAndModify",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"findAndModify": "test",
"query": {
"_id": 4
},
"remove": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "findAndModify",
"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"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
},
{
"_id": 2
}
]
}
}
},
{
"description": "collection writeConcern ignored for findOneAndDelete",
"operations": [
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"writeConcern": {
"w": "majority"
}
}
}
},
{
"name": "findOneAndDelete",
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": "majority"
}
},
"arguments": {
"session": "session0",
"filter": {
"_id": 3
}
},
"result": {
"_id": 3
}
},
{
"name": "commitTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"findAndModify": "test",
"query": {
"_id": 3
},
"remove": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"readConcern": null,
"writeConcern": null
},
"command_name": "findAndModify",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"readConcern": null,
"writeConcern": {
"w": "majority"
}
},
"command_name": "commitTransaction",
"database_name": "admin"
}
}
]
}
]
}