mongo-python-driver/test/transactions/delete.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

318 lines
7.3 KiB
JSON

{
"topology": [
"replicaset",
"sharded"
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [
{
"_id": 1
},
{
"_id": 2
},
{
"_id": 3
},
{
"_id": 4
},
{
"_id": 5
}
],
"tests": [
{
"description": "delete",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "deleteOne",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 1
}
},
"result": {
"deletedCount": 1
}
},
{
"name": "deleteMany",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": {
"$lte": 3
}
}
},
"result": {
"deletedCount": 2
}
},
{
"name": "deleteOne",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 4
}
},
"result": {
"deletedCount": 1
}
},
{
"name": "commitTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "test",
"deletes": [
{
"q": {
"_id": 1
},
"limit": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "delete",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"delete": "test",
"deletes": [
{
"q": {
"_id": {
"$lte": 3
}
},
"limit": 0
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "delete",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"delete": "test",
"deletes": [
{
"q": {
"_id": 4
},
"limit": 1
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "delete",
"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": [
{
"_id": 5
}
]
}
}
},
{
"description": "collection writeConcern ignored for delete",
"operations": [
{
"name": "startTransaction",
"object": "session0",
"arguments": {
"options": {
"writeConcern": {
"w": "majority"
}
}
}
},
{
"name": "deleteOne",
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": "majority"
}
},
"arguments": {
"session": "session0",
"filter": {
"_id": 1
}
},
"result": {
"deletedCount": 1
}
},
{
"name": "deleteMany",
"object": "collection",
"collectionOptions": {
"writeConcern": {
"w": "majority"
}
},
"arguments": {
"session": "session0",
"filter": {
"_id": {
"$lte": 3
}
}
},
"result": {
"deletedCount": 2
}
},
{
"name": "commitTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"delete": "test",
"deletes": [
{
"q": {
"_id": 1
},
"limit": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "delete",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"delete": "test",
"deletes": [
{
"q": {
"_id": {
"$lte": 3
}
},
"limit": 0
}
],
"ordered": true,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "delete",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": {
"w": "majority"
}
},
"command_name": "commitTransaction",
"database_name": "admin"
}
}
]
}
]
}