| 1 |
runOn: |
| 2 |
- minServerVersion: "4.0" |
| 3 |
topology: ["replicaset"] |
| 4 |
|
| 5 |
database_name: &database_name "transaction-tests" |
| 6 |
collection_name: &collection_name "test" |
| 7 |
|
| 8 |
data: [] |
| 9 |
|
| 10 |
tests: |
| 11 |
|
| 12 |
- description: readConcern snapshot in startTransaction options |
| 13 |
|
| 14 |
sessionOptions: |
| 15 |
session0: |
| 16 |
defaultTransactionOptions: |
| 17 |
readConcern: |
| 18 |
level: majority |
| 19 |
|
| 20 |
operations: |
| 21 |
- name: startTransaction |
| 22 |
object: session0 |
| 23 |
arguments: |
| 24 |
options: |
| 25 |
readConcern: |
| 26 |
level: snapshot |
| 27 |
- name: insertOne |
| 28 |
object: collection |
| 29 |
arguments: |
| 30 |
session: session0 |
| 31 |
document: |
| 32 |
_id: 1 |
| 33 |
result: |
| 34 |
insertedId: 1 |
| 35 |
- name: commitTransaction |
| 36 |
object: session0 |
| 37 |
|
| 38 |
- name: startTransaction |
| 39 |
object: session0 |
| 40 |
arguments: |
| 41 |
options: |
| 42 |
readConcern: |
| 43 |
level: snapshot |
| 44 |
- name: insertOne |
| 45 |
object: collection |
| 46 |
arguments: |
| 47 |
session: session0 |
| 48 |
document: |
| 49 |
_id: 2 |
| 50 |
result: |
| 51 |
insertedId: 2 |
| 52 |
- name: abortTransaction |
| 53 |
object: session0 |
| 54 |
|
| 55 |
expectations: |
| 56 |
- command_started_event: |
| 57 |
command: |
| 58 |
insert: *collection_name |
| 59 |
documents: |
| 60 |
- _id: 1 |
| 61 |
ordered: true |
| 62 |
lsid: session0 |
| 63 |
txnNumber: |
| 64 |
$numberLong: "1" |
| 65 |
startTransaction: true |
| 66 |
autocommit: false |
| 67 |
readConcern: |
| 68 |
level: snapshot |
| 69 |
writeConcern: |
| 70 |
command_name: insert |
| 71 |
database_name: *database_name |
| 72 |
- command_started_event: |
| 73 |
command: |
| 74 |
commitTransaction: 1 |
| 75 |
lsid: session0 |
| 76 |
txnNumber: |
| 77 |
$numberLong: "1" |
| 78 |
startTransaction: |
| 79 |
autocommit: false |
| 80 |
readConcern: |
| 81 |
writeConcern: |
| 82 |
command_name: commitTransaction |
| 83 |
database_name: admin |
| 84 |
- command_started_event: |
| 85 |
command: |
| 86 |
insert: *collection_name |
| 87 |
documents: |
| 88 |
- _id: 2 |
| 89 |
ordered: true |
| 90 |
lsid: session0 |
| 91 |
txnNumber: |
| 92 |
$numberLong: "2" |
| 93 |
startTransaction: true |
| 94 |
autocommit: false |
| 95 |
readConcern: |
| 96 |
level: snapshot |
| 97 |
afterClusterTime: 42 |
| 98 |
writeConcern: |
| 99 |
command_name: insert |
| 100 |
database_name: *database_name |
| 101 |
- command_started_event: |
| 102 |
command: |
| 103 |
abortTransaction: 1 |
| 104 |
lsid: session0 |
| 105 |
txnNumber: |
| 106 |
$numberLong: "2" |
| 107 |
startTransaction: |
| 108 |
autocommit: false |
| 109 |
readConcern: |
| 110 |
writeConcern: |
| 111 |
command_name: abortTransaction |
| 112 |
database_name: admin |
| 113 |
|
| 114 |
outcome: |
| 115 |
collection: |
| 116 |
data: |
| 117 |
- _id: 1 |