| 1 | { |
| 2 | "runOn": [ |
| 3 | { |
| 4 | "minServerVersion": "4.0", |
| 5 | "topology": [ |
| 6 | "replicaset" |
| 7 | ] |
| 8 | }, |
| 9 | { |
| 10 | "minServerVersion": "4.1.8", |
| 11 | "topology": [ |
| 12 | "sharded" |
| 13 | ] |
| 14 | } |
| 15 | ], |
| 16 | "database_name": "transaction-tests", |
| 17 | "collection_name": "test", |
| 18 | "data": [ |
| 19 | { |
| 20 | "_id": 1, |
| 21 | "count": 0 |
| 22 | } |
| 23 | ], |
| 24 | "tests": [ |
| 25 | { |
| 26 | "description": "causal consistency", |
| 27 | "clientOptions": { |
| 28 | "retryWrites": false |
| 29 | }, |
| 30 | "operations": [ |
| 31 | { |
| 32 | "name": "updateOne", |
| 33 | "object": "collection", |
| 34 | "arguments": { |
| 35 | "session": "session0", |
| 36 | "filter": { |
| 37 | "_id": 1 |
| 38 | }, |
| 39 | "update": { |
| 40 | "$inc": { |
| 41 | "count": 1 |
| 42 | } |
| 43 | } |
| 44 | }, |
| 45 | "result": { |
| 46 | "matchedCount": 1, |
| 47 | "modifiedCount": 1, |
| 48 | "upsertedCount": 0 |
| 49 | } |
| 50 | }, |
| 51 | { |
| 52 | "name": "startTransaction", |
| 53 | "object": "session0" |
| 54 | }, |
| 55 | { |
| 56 | "name": "updateOne", |
| 57 | "object": "collection", |
| 58 | "arguments": { |
| 59 | "session": "session0", |
| 60 | "filter": { |
| 61 | "_id": 1 |
| 62 | }, |
| 63 | "update": { |
| 64 | "$inc": { |
| 65 | "count": 1 |
| 66 | } |
| 67 | } |
| 68 | }, |
| 69 | "result": { |
| 70 | "matchedCount": 1, |
| 71 | "modifiedCount": 1, |
| 72 | "upsertedCount": 0 |
| 73 | } |
| 74 | }, |
| 75 | { |
| 76 | "name": "commitTransaction", |
| 77 | "object": "session0" |
| 78 | } |
| 79 | ], |
| 80 | "expectations": [ |
| 81 | { |
| 82 | "command_started_event": { |
| 83 | "command": { |
| 84 | "update": "test", |
| 85 | "updates": [ |
| 86 | { |
| 87 | "q": { |
| 88 | "_id": 1 |
| 89 | }, |
| 90 | "u": { |
| 91 | "$inc": { |
| 92 | "count": 1 |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | ], |
| 97 | "ordered": true, |
| 98 | "lsid": "session0", |
| 99 | "readConcern": null, |
| 100 | "txnNumber": null, |
| 101 | "startTransaction": null, |
| 102 | "autocommit": null, |
| 103 | "writeConcern": null |
| 104 | }, |
| 105 | "command_name": "update", |
| 106 | "database_name": "transaction-tests" |
| 107 | } |
| 108 | }, |
| 109 | { |
| 110 | "command_started_event": { |
| 111 | "command": { |
| 112 | "update": "test", |
| 113 | "updates": [ |
| 114 | { |
| 115 | "q": { |
| 116 | "_id": 1 |
| 117 | }, |
| 118 | "u": { |
| 119 | "$inc": { |
| 120 | "count": 1 |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | ], |
| 125 | "ordered": true, |
| 126 | "readConcern": { |
| 127 | "afterClusterTime": 42 |
| 128 | }, |
| 129 | "lsid": "session0", |
| 130 | "txnNumber": { |
| 131 | "$numberLong": "1" |
| 132 | }, |
| 133 | "startTransaction": true, |
| 134 | "autocommit": false, |
| 135 | "writeConcern": null |
| 136 | }, |
| 137 | "command_name": "update", |
| 138 | "database_name": "transaction-tests" |
| 139 | } |
| 140 | }, |
| 141 | { |
| 142 | "command_started_event": { |
| 143 | "command": { |
| 144 | "commitTransaction": 1, |
| 145 | "lsid": "session0", |
| 146 | "txnNumber": { |
| 147 | "$numberLong": "1" |
| 148 | }, |
| 149 | "startTransaction": null, |
| 150 | "autocommit": false, |
| 151 | "writeConcern": null |
| 152 | }, |
| 153 | "command_name": "commitTransaction", |
| 154 | "database_name": "admin" |
| 155 | } |
| 156 | } |
| 157 | ], |
| 158 | "outcome": { |
| 159 | "collection": { |
| 160 | "data": [ |
| 161 | { |
| 162 | "_id": 1, |
| 163 | "count": 2 |
| 164 | } |
| 165 | ] |
| 166 | } |
| 167 | } |
| 168 | }, |
| 169 | { |
| 170 | "description": "causal consistency disabled", |
| 171 | "clientOptions": { |
| 172 | "retryWrites": false |
| 173 | }, |
| 174 | "sessionOptions": { |
| 175 | "session0": { |
| 176 | "causalConsistency": false |
| 177 | } |
| 178 | }, |
| 179 | "operations": [ |
| 180 | { |
| 181 | "name": "insertOne", |
| 182 | "object": "collection", |
| 183 | "arguments": { |
| 184 | "session": "session0", |
| 185 | "document": { |
| 186 | "_id": 2 |
| 187 | } |
| 188 | }, |
| 189 | "result": { |
| 190 | "insertedId": 2 |
| 191 | } |
| 192 | }, |
| 193 | { |
| 194 | "name": "startTransaction", |
| 195 | "object": "session0" |
| 196 | }, |
| 197 | { |
| 198 | "name": "updateOne", |
| 199 | "object": "collection", |
| 200 | "arguments": { |
| 201 | "session": "session0", |
| 202 | "filter": { |
| 203 | "_id": 1 |
| 204 | }, |
| 205 | "update": { |
| 206 | "$inc": { |
| 207 | "count": 1 |
| 208 | } |
| 209 | } |
| 210 | }, |
| 211 | "result": { |
| 212 | "matchedCount": 1, |
| 213 | "modifiedCount": 1, |
| 214 | "upsertedCount": 0 |
| 215 | } |
| 216 | }, |
| 217 | { |
| 218 | "name": "commitTransaction", |
| 219 | "object": "session0" |
| 220 | } |
| 221 | ], |
| 222 | "expectations": [ |
| 223 | { |
| 224 | "command_started_event": { |
| 225 | "command": { |
| 226 | "insert": "test", |
| 227 | "documents": [ |
| 228 | { |
| 229 | "_id": 2 |
| 230 | } |
| 231 | ], |
| 232 | "ordered": true, |
| 233 | "readConcern": null, |
| 234 | "lsid": "session0", |
| 235 | "txnNumber": null, |
| 236 | "autocommit": null, |
| 237 | "writeConcern": null |
| 238 | }, |
| 239 | "command_name": "insert", |
| 240 | "database_name": "transaction-tests" |
| 241 | } |
| 242 | }, |
| 243 | { |
| 244 | "command_started_event": { |
| 245 | "command": { |
| 246 | "update": "test", |
| 247 | "updates": [ |
| 248 | { |
| 249 | "q": { |
| 250 | "_id": 1 |
| 251 | }, |
| 252 | "u": { |
| 253 | "$inc": { |
| 254 | "count": 1 |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | ], |
| 259 | "ordered": true, |
| 260 | "readConcern": null, |
| 261 | "lsid": "session0", |
| 262 | "txnNumber": { |
| 263 | "$numberLong": "1" |
| 264 | }, |
| 265 | "startTransaction": true, |
| 266 | "autocommit": false, |
| 267 | "writeConcern": null |
| 268 | }, |
| 269 | "command_name": "update", |
| 270 | "database_name": "transaction-tests" |
| 271 | } |
| 272 | }, |
| 273 | { |
| 274 | "command_started_event": { |
| 275 | "command": { |
| 276 | "commitTransaction": 1, |
| 277 | "lsid": "session0", |
| 278 | "txnNumber": { |
| 279 | "$numberLong": "1" |
| 280 | }, |
| 281 | "startTransaction": null, |
| 282 | "autocommit": false, |
| 283 | "writeConcern": null |
| 284 | }, |
| 285 | "command_name": "commitTransaction", |
| 286 | "database_name": "admin" |
| 287 | } |
| 288 | } |
| 289 | ], |
| 290 | "outcome": { |
| 291 | "collection": { |
| 292 | "data": [ |
| 293 | { |
| 294 | "_id": 1, |
| 295 | "count": 1 |
| 296 | }, |
| 297 | { |
| 298 | "_id": 2 |
| 299 | } |
| 300 | ] |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | ] |
| 305 | } |