| 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 | "serverless": "forbid" |
| 15 | } |
| 16 | ], |
| 17 | "database_name": "transaction-tests", |
| 18 | "collection_name": "test", |
| 19 | "data": [], |
| 20 | "tests": [ |
| 21 | { |
| 22 | "description": "DuplicateKey errors do not contain transient label", |
| 23 | "operations": [ |
| 24 | { |
| 25 | "name": "startTransaction", |
| 26 | "object": "session0" |
| 27 | }, |
| 28 | { |
| 29 | "name": "insertMany", |
| 30 | "object": "collection", |
| 31 | "arguments": { |
| 32 | "session": "session0", |
| 33 | "documents": [ |
| 34 | { |
| 35 | "_id": 1 |
| 36 | }, |
| 37 | { |
| 38 | "_id": 1 |
| 39 | } |
| 40 | ] |
| 41 | }, |
| 42 | "result": { |
| 43 | "errorLabelsOmit": [ |
| 44 | "TransientTransactionError", |
| 45 | "UnknownTransactionCommitResult" |
| 46 | ], |
| 47 | "errorContains": "E11000" |
| 48 | } |
| 49 | }, |
| 50 | { |
| 51 | "name": "abortTransaction", |
| 52 | "object": "session0" |
| 53 | } |
| 54 | ], |
| 55 | "expectations": [ |
| 56 | { |
| 57 | "command_started_event": { |
| 58 | "command": { |
| 59 | "insert": "test", |
| 60 | "documents": [ |
| 61 | { |
| 62 | "_id": 1 |
| 63 | }, |
| 64 | { |
| 65 | "_id": 1 |
| 66 | } |
| 67 | ], |
| 68 | "ordered": true, |
| 69 | "readConcern": null, |
| 70 | "lsid": "session0", |
| 71 | "txnNumber": { |
| 72 | "$numberLong": "1" |
| 73 | }, |
| 74 | "startTransaction": true, |
| 75 | "autocommit": false, |
| 76 | "writeConcern": null |
| 77 | }, |
| 78 | "command_name": "insert", |
| 79 | "database_name": "transaction-tests" |
| 80 | } |
| 81 | }, |
| 82 | { |
| 83 | "command_started_event": { |
| 84 | "command": { |
| 85 | "abortTransaction": 1, |
| 86 | "lsid": "session0", |
| 87 | "txnNumber": { |
| 88 | "$numberLong": "1" |
| 89 | }, |
| 90 | "startTransaction": null, |
| 91 | "autocommit": false, |
| 92 | "writeConcern": null |
| 93 | }, |
| 94 | "command_name": "abortTransaction", |
| 95 | "database_name": "admin" |
| 96 | } |
| 97 | } |
| 98 | ], |
| 99 | "outcome": { |
| 100 | "collection": { |
| 101 | "data": [] |
| 102 | } |
| 103 | } |
| 104 | }, |
| 105 | { |
| 106 | "description": "NotWritablePrimary errors contain transient label", |
| 107 | "failPoint": { |
| 108 | "configureFailPoint": "failCommand", |
| 109 | "mode": { |
| 110 | "times": 1 |
| 111 | }, |
| 112 | "data": { |
| 113 | "failCommands": [ |
| 114 | "insert" |
| 115 | ], |
| 116 | "errorCode": 10107 |
| 117 | } |
| 118 | }, |
| 119 | "operations": [ |
| 120 | { |
| 121 | "name": "startTransaction", |
| 122 | "object": "session0" |
| 123 | }, |
| 124 | { |
| 125 | "name": "insertOne", |
| 126 | "object": "collection", |
| 127 | "arguments": { |
| 128 | "session": "session0", |
| 129 | "document": { |
| 130 | "_id": 1 |
| 131 | } |
| 132 | }, |
| 133 | "result": { |
| 134 | "errorLabelsContain": [ |
| 135 | "TransientTransactionError" |
| 136 | ], |
| 137 | "errorLabelsOmit": [ |
| 138 | "RetryableWriteError", |
| 139 | "UnknownTransactionCommitResult" |
| 140 | ] |
| 141 | } |
| 142 | }, |
| 143 | { |
| 144 | "name": "abortTransaction", |
| 145 | "object": "session0" |
| 146 | } |
| 147 | ], |
| 148 | "expectations": [ |
| 149 | { |
| 150 | "command_started_event": { |
| 151 | "command": { |
| 152 | "insert": "test", |
| 153 | "documents": [ |
| 154 | { |
| 155 | "_id": 1 |
| 156 | } |
| 157 | ], |
| 158 | "ordered": true, |
| 159 | "readConcern": null, |
| 160 | "lsid": "session0", |
| 161 | "txnNumber": { |
| 162 | "$numberLong": "1" |
| 163 | }, |
| 164 | "startTransaction": true, |
| 165 | "autocommit": false, |
| 166 | "writeConcern": null |
| 167 | }, |
| 168 | "command_name": "insert", |
| 169 | "database_name": "transaction-tests" |
| 170 | } |
| 171 | }, |
| 172 | { |
| 173 | "command_started_event": { |
| 174 | "command": { |
| 175 | "abortTransaction": 1, |
| 176 | "lsid": "session0", |
| 177 | "txnNumber": { |
| 178 | "$numberLong": "1" |
| 179 | }, |
| 180 | "startTransaction": null, |
| 181 | "autocommit": false, |
| 182 | "writeConcern": null |
| 183 | }, |
| 184 | "command_name": "abortTransaction", |
| 185 | "database_name": "admin" |
| 186 | } |
| 187 | } |
| 188 | ], |
| 189 | "outcome": { |
| 190 | "collection": { |
| 191 | "data": [] |
| 192 | } |
| 193 | } |
| 194 | }, |
| 195 | { |
| 196 | "description": "WriteConflict errors contain transient label", |
| 197 | "failPoint": { |
| 198 | "configureFailPoint": "failCommand", |
| 199 | "mode": { |
| 200 | "times": 1 |
| 201 | }, |
| 202 | "data": { |
| 203 | "failCommands": [ |
| 204 | "insert" |
| 205 | ], |
| 206 | "errorCode": 112 |
| 207 | } |
| 208 | }, |
| 209 | "operations": [ |
| 210 | { |
| 211 | "name": "startTransaction", |
| 212 | "object": "session0" |
| 213 | }, |
| 214 | { |
| 215 | "name": "insertOne", |
| 216 | "object": "collection", |
| 217 | "arguments": { |
| 218 | "session": "session0", |
| 219 | "document": { |
| 220 | "_id": 1 |
| 221 | } |
| 222 | }, |
| 223 | "result": { |
| 224 | "errorLabelsContain": [ |
| 225 | "TransientTransactionError" |
| 226 | ], |
| 227 | "errorLabelsOmit": [ |
| 228 | "RetryableWriteError", |
| 229 | "UnknownTransactionCommitResult" |
| 230 | ] |
| 231 | } |
| 232 | }, |
| 233 | { |
| 234 | "name": "abortTransaction", |
| 235 | "object": "session0" |
| 236 | } |
| 237 | ], |
| 238 | "expectations": [ |
| 239 | { |
| 240 | "command_started_event": { |
| 241 | "command": { |
| 242 | "insert": "test", |
| 243 | "documents": [ |
| 244 | { |
| 245 | "_id": 1 |
| 246 | } |
| 247 | ], |
| 248 | "ordered": true, |
| 249 | "readConcern": null, |
| 250 | "lsid": "session0", |
| 251 | "txnNumber": { |
| 252 | "$numberLong": "1" |
| 253 | }, |
| 254 | "startTransaction": true, |
| 255 | "autocommit": false, |
| 256 | "writeConcern": null |
| 257 | }, |
| 258 | "command_name": "insert", |
| 259 | "database_name": "transaction-tests" |
| 260 | } |
| 261 | }, |
| 262 | { |
| 263 | "command_started_event": { |
| 264 | "command": { |
| 265 | "abortTransaction": 1, |
| 266 | "lsid": "session0", |
| 267 | "txnNumber": { |
| 268 | "$numberLong": "1" |
| 269 | }, |
| 270 | "startTransaction": null, |
| 271 | "autocommit": false, |
| 272 | "writeConcern": null |
| 273 | }, |
| 274 | "command_name": "abortTransaction", |
| 275 | "database_name": "admin" |
| 276 | } |
| 277 | } |
| 278 | ], |
| 279 | "outcome": { |
| 280 | "collection": { |
| 281 | "data": [] |
| 282 | } |
| 283 | } |
| 284 | }, |
| 285 | { |
| 286 | "description": "NoSuchTransaction errors contain transient label", |
| 287 | "failPoint": { |
| 288 | "configureFailPoint": "failCommand", |
| 289 | "mode": { |
| 290 | "times": 1 |
| 291 | }, |
| 292 | "data": { |
| 293 | "failCommands": [ |
| 294 | "insert" |
| 295 | ], |
| 296 | "errorCode": 251 |
| 297 | } |
| 298 | }, |
| 299 | "operations": [ |
| 300 | { |
| 301 | "name": "startTransaction", |
| 302 | "object": "session0" |
| 303 | }, |
| 304 | { |
| 305 | "name": "insertOne", |
| 306 | "object": "collection", |
| 307 | "arguments": { |
| 308 | "session": "session0", |
| 309 | "document": { |
| 310 | "_id": 1 |
| 311 | } |
| 312 | }, |
| 313 | "result": { |
| 314 | "errorLabelsContain": [ |
| 315 | "TransientTransactionError" |
| 316 | ], |
| 317 | "errorLabelsOmit": [ |
| 318 | "RetryableWriteError", |
| 319 | "UnknownTransactionCommitResult" |
| 320 | ] |
| 321 | } |
| 322 | }, |
| 323 | { |
| 324 | "name": "abortTransaction", |
| 325 | "object": "session0" |
| 326 | } |
| 327 | ], |
| 328 | "expectations": [ |
| 329 | { |
| 330 | "command_started_event": { |
| 331 | "command": { |
| 332 | "insert": "test", |
| 333 | "documents": [ |
| 334 | { |
| 335 | "_id": 1 |
| 336 | } |
| 337 | ], |
| 338 | "ordered": true, |
| 339 | "readConcern": null, |
| 340 | "lsid": "session0", |
| 341 | "txnNumber": { |
| 342 | "$numberLong": "1" |
| 343 | }, |
| 344 | "startTransaction": true, |
| 345 | "autocommit": false, |
| 346 | "writeConcern": null |
| 347 | }, |
| 348 | "command_name": "insert", |
| 349 | "database_name": "transaction-tests" |
| 350 | } |
| 351 | }, |
| 352 | { |
| 353 | "command_started_event": { |
| 354 | "command": { |
| 355 | "abortTransaction": 1, |
| 356 | "lsid": "session0", |
| 357 | "txnNumber": { |
| 358 | "$numberLong": "1" |
| 359 | }, |
| 360 | "startTransaction": null, |
| 361 | "autocommit": false, |
| 362 | "writeConcern": null |
| 363 | }, |
| 364 | "command_name": "abortTransaction", |
| 365 | "database_name": "admin" |
| 366 | } |
| 367 | } |
| 368 | ], |
| 369 | "outcome": { |
| 370 | "collection": { |
| 371 | "data": [] |
| 372 | } |
| 373 | } |
| 374 | }, |
| 375 | { |
| 376 | "description": "NoSuchTransaction errors on commit contain transient label", |
| 377 | "failPoint": { |
| 378 | "configureFailPoint": "failCommand", |
| 379 | "mode": { |
| 380 | "times": 1 |
| 381 | }, |
| 382 | "data": { |
| 383 | "failCommands": [ |
| 384 | "commitTransaction" |
| 385 | ], |
| 386 | "errorCode": 251 |
| 387 | } |
| 388 | }, |
| 389 | "operations": [ |
| 390 | { |
| 391 | "name": "startTransaction", |
| 392 | "object": "session0" |
| 393 | }, |
| 394 | { |
| 395 | "name": "insertOne", |
| 396 | "object": "collection", |
| 397 | "arguments": { |
| 398 | "session": "session0", |
| 399 | "document": { |
| 400 | "_id": 1 |
| 401 | } |
| 402 | }, |
| 403 | "result": { |
| 404 | "insertedId": 1 |
| 405 | } |
| 406 | }, |
| 407 | { |
| 408 | "name": "commitTransaction", |
| 409 | "object": "session0", |
| 410 | "result": { |
| 411 | "errorLabelsContain": [ |
| 412 | "TransientTransactionError" |
| 413 | ], |
| 414 | "errorLabelsOmit": [ |
| 415 | "RetryableWriteError", |
| 416 | "UnknownTransactionCommitResult" |
| 417 | ] |
| 418 | } |
| 419 | } |
| 420 | ], |
| 421 | "expectations": [ |
| 422 | { |
| 423 | "command_started_event": { |
| 424 | "command": { |
| 425 | "insert": "test", |
| 426 | "documents": [ |
| 427 | { |
| 428 | "_id": 1 |
| 429 | } |
| 430 | ], |
| 431 | "ordered": true, |
| 432 | "readConcern": null, |
| 433 | "lsid": "session0", |
| 434 | "txnNumber": { |
| 435 | "$numberLong": "1" |
| 436 | }, |
| 437 | "startTransaction": true, |
| 438 | "autocommit": false, |
| 439 | "writeConcern": null |
| 440 | }, |
| 441 | "command_name": "insert", |
| 442 | "database_name": "transaction-tests" |
| 443 | } |
| 444 | }, |
| 445 | { |
| 446 | "command_started_event": { |
| 447 | "command": { |
| 448 | "commitTransaction": 1, |
| 449 | "lsid": "session0", |
| 450 | "txnNumber": { |
| 451 | "$numberLong": "1" |
| 452 | }, |
| 453 | "startTransaction": null, |
| 454 | "autocommit": false, |
| 455 | "writeConcern": null |
| 456 | }, |
| 457 | "command_name": "commitTransaction", |
| 458 | "database_name": "admin" |
| 459 | } |
| 460 | } |
| 461 | ], |
| 462 | "outcome": { |
| 463 | "collection": { |
| 464 | "data": [] |
| 465 | } |
| 466 | } |
| 467 | }, |
| 468 | { |
| 469 | "description": "add TransientTransactionError label to connection errors, but do not add RetryableWriteError label", |
| 470 | "failPoint": { |
| 471 | "configureFailPoint": "failCommand", |
| 472 | "mode": { |
| 473 | "times": 4 |
| 474 | }, |
| 475 | "data": { |
| 476 | "failCommands": [ |
| 477 | "insert", |
| 478 | "find", |
| 479 | "aggregate", |
| 480 | "distinct" |
| 481 | ], |
| 482 | "closeConnection": true |
| 483 | } |
| 484 | }, |
| 485 | "operations": [ |
| 486 | { |
| 487 | "name": "startTransaction", |
| 488 | "object": "session0" |
| 489 | }, |
| 490 | { |
| 491 | "name": "insertOne", |
| 492 | "object": "collection", |
| 493 | "arguments": { |
| 494 | "session": "session0", |
| 495 | "document": { |
| 496 | "_id": 1 |
| 497 | } |
| 498 | }, |
| 499 | "result": { |
| 500 | "errorLabelsContain": [ |
| 501 | "TransientTransactionError" |
| 502 | ], |
| 503 | "errorLabelsOmit": [ |
| 504 | "RetryableWriteError", |
| 505 | "UnknownTransactionCommitResult" |
| 506 | ] |
| 507 | } |
| 508 | }, |
| 509 | { |
| 510 | "name": "find", |
| 511 | "object": "collection", |
| 512 | "arguments": { |
| 513 | "session": "session0" |
| 514 | }, |
| 515 | "result": { |
| 516 | "errorLabelsContain": [ |
| 517 | "TransientTransactionError" |
| 518 | ], |
| 519 | "errorLabelsOmit": [ |
| 520 | "RetryableWriteError", |
| 521 | "UnknownTransactionCommitResult" |
| 522 | ] |
| 523 | } |
| 524 | }, |
| 525 | { |
| 526 | "name": "aggregate", |
| 527 | "object": "collection", |
| 528 | "arguments": { |
| 529 | "pipeline": [ |
| 530 | { |
| 531 | "$project": { |
| 532 | "_id": 1 |
| 533 | } |
| 534 | } |
| 535 | ], |
| 536 | "session": "session0" |
| 537 | }, |
| 538 | "result": { |
| 539 | "errorLabelsContain": [ |
| 540 | "TransientTransactionError" |
| 541 | ], |
| 542 | "errorLabelsOmit": [ |
| 543 | "RetryableWriteError", |
| 544 | "UnknownTransactionCommitResult" |
| 545 | ] |
| 546 | } |
| 547 | }, |
| 548 | { |
| 549 | "name": "distinct", |
| 550 | "object": "collection", |
| 551 | "arguments": { |
| 552 | "fieldName": "_id", |
| 553 | "session": "session0" |
| 554 | }, |
| 555 | "result": { |
| 556 | "errorLabelsContain": [ |
| 557 | "TransientTransactionError" |
| 558 | ], |
| 559 | "errorLabelsOmit": [ |
| 560 | "RetryableWriteError", |
| 561 | "UnknownTransactionCommitResult" |
| 562 | ] |
| 563 | } |
| 564 | }, |
| 565 | { |
| 566 | "name": "abortTransaction", |
| 567 | "object": "session0" |
| 568 | } |
| 569 | ], |
| 570 | "expectations": [ |
| 571 | { |
| 572 | "command_started_event": { |
| 573 | "command": { |
| 574 | "insert": "test", |
| 575 | "documents": [ |
| 576 | { |
| 577 | "_id": 1 |
| 578 | } |
| 579 | ], |
| 580 | "ordered": true, |
| 581 | "readConcern": null, |
| 582 | "lsid": "session0", |
| 583 | "txnNumber": { |
| 584 | "$numberLong": "1" |
| 585 | }, |
| 586 | "startTransaction": true, |
| 587 | "autocommit": false, |
| 588 | "writeConcern": null |
| 589 | }, |
| 590 | "command_name": "insert", |
| 591 | "database_name": "transaction-tests" |
| 592 | } |
| 593 | }, |
| 594 | { |
| 595 | "command_started_event": { |
| 596 | "command": { |
| 597 | "find": "test", |
| 598 | "readConcern": null, |
| 599 | "lsid": "session0", |
| 600 | "txnNumber": { |
| 601 | "$numberLong": "1" |
| 602 | }, |
| 603 | "startTransaction": null, |
| 604 | "autocommit": false |
| 605 | }, |
| 606 | "command_name": "find", |
| 607 | "database_name": "transaction-tests" |
| 608 | } |
| 609 | }, |
| 610 | { |
| 611 | "command_started_event": { |
| 612 | "command": { |
| 613 | "aggregate": "test", |
| 614 | "pipeline": [ |
| 615 | { |
| 616 | "$project": { |
| 617 | "_id": 1 |
| 618 | } |
| 619 | } |
| 620 | ], |
| 621 | "cursor": {}, |
| 622 | "readConcern": null, |
| 623 | "lsid": "session0", |
| 624 | "txnNumber": { |
| 625 | "$numberLong": "1" |
| 626 | }, |
| 627 | "startTransaction": null, |
| 628 | "autocommit": false |
| 629 | }, |
| 630 | "command_name": "aggregate", |
| 631 | "database_name": "transaction-tests" |
| 632 | } |
| 633 | }, |
| 634 | { |
| 635 | "command_started_event": { |
| 636 | "command": { |
| 637 | "distinct": "test", |
| 638 | "key": "_id", |
| 639 | "lsid": "session0", |
| 640 | "readConcern": null, |
| 641 | "txnNumber": { |
| 642 | "$numberLong": "1" |
| 643 | }, |
| 644 | "startTransaction": null, |
| 645 | "autocommit": false |
| 646 | }, |
| 647 | "command_name": "distinct", |
| 648 | "database_name": "transaction-tests" |
| 649 | } |
| 650 | }, |
| 651 | { |
| 652 | "command_started_event": { |
| 653 | "command": { |
| 654 | "abortTransaction": 1, |
| 655 | "lsid": "session0", |
| 656 | "txnNumber": { |
| 657 | "$numberLong": "1" |
| 658 | }, |
| 659 | "startTransaction": null, |
| 660 | "autocommit": false, |
| 661 | "writeConcern": null |
| 662 | }, |
| 663 | "command_name": "abortTransaction", |
| 664 | "database_name": "admin" |
| 665 | } |
| 666 | } |
| 667 | ], |
| 668 | "outcome": { |
| 669 | "collection": { |
| 670 | "data": [] |
| 671 | } |
| 672 | } |
| 673 | }, |
| 674 | { |
| 675 | "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors", |
| 676 | "failPoint": { |
| 677 | "configureFailPoint": "failCommand", |
| 678 | "mode": { |
| 679 | "times": 2 |
| 680 | }, |
| 681 | "data": { |
| 682 | "failCommands": [ |
| 683 | "commitTransaction" |
| 684 | ], |
| 685 | "closeConnection": true |
| 686 | } |
| 687 | }, |
| 688 | "operations": [ |
| 689 | { |
| 690 | "name": "startTransaction", |
| 691 | "object": "session0" |
| 692 | }, |
| 693 | { |
| 694 | "name": "insertOne", |
| 695 | "object": "collection", |
| 696 | "arguments": { |
| 697 | "session": "session0", |
| 698 | "document": { |
| 699 | "_id": 1 |
| 700 | } |
| 701 | }, |
| 702 | "result": { |
| 703 | "insertedId": 1 |
| 704 | } |
| 705 | }, |
| 706 | { |
| 707 | "name": "commitTransaction", |
| 708 | "object": "session0", |
| 709 | "result": { |
| 710 | "errorLabelsContain": [ |
| 711 | "RetryableWriteError", |
| 712 | "UnknownTransactionCommitResult" |
| 713 | ], |
| 714 | "errorLabelsOmit": [ |
| 715 | "TransientTransactionError" |
| 716 | ] |
| 717 | } |
| 718 | }, |
| 719 | { |
| 720 | "name": "commitTransaction", |
| 721 | "object": "session0" |
| 722 | } |
| 723 | ], |
| 724 | "expectations": [ |
| 725 | { |
| 726 | "command_started_event": { |
| 727 | "command": { |
| 728 | "insert": "test", |
| 729 | "documents": [ |
| 730 | { |
| 731 | "_id": 1 |
| 732 | } |
| 733 | ], |
| 734 | "ordered": true, |
| 735 | "readConcern": null, |
| 736 | "lsid": "session0", |
| 737 | "txnNumber": { |
| 738 | "$numberLong": "1" |
| 739 | }, |
| 740 | "startTransaction": true, |
| 741 | "autocommit": false, |
| 742 | "writeConcern": null |
| 743 | }, |
| 744 | "command_name": "insert", |
| 745 | "database_name": "transaction-tests" |
| 746 | } |
| 747 | }, |
| 748 | { |
| 749 | "command_started_event": { |
| 750 | "command": { |
| 751 | "commitTransaction": 1, |
| 752 | "lsid": "session0", |
| 753 | "txnNumber": { |
| 754 | "$numberLong": "1" |
| 755 | }, |
| 756 | "startTransaction": null, |
| 757 | "autocommit": false, |
| 758 | "writeConcern": null |
| 759 | }, |
| 760 | "command_name": "commitTransaction", |
| 761 | "database_name": "admin" |
| 762 | } |
| 763 | }, |
| 764 | { |
| 765 | "command_started_event": { |
| 766 | "command": { |
| 767 | "commitTransaction": 1, |
| 768 | "lsid": "session0", |
| 769 | "txnNumber": { |
| 770 | "$numberLong": "1" |
| 771 | }, |
| 772 | "startTransaction": null, |
| 773 | "autocommit": false, |
| 774 | "writeConcern": { |
| 775 | "w": "majority", |
| 776 | "wtimeout": 10000 |
| 777 | } |
| 778 | }, |
| 779 | "command_name": "commitTransaction", |
| 780 | "database_name": "admin" |
| 781 | } |
| 782 | }, |
| 783 | { |
| 784 | "command_started_event": { |
| 785 | "command": { |
| 786 | "commitTransaction": 1, |
| 787 | "lsid": "session0", |
| 788 | "txnNumber": { |
| 789 | "$numberLong": "1" |
| 790 | }, |
| 791 | "startTransaction": null, |
| 792 | "autocommit": false, |
| 793 | "writeConcern": { |
| 794 | "w": "majority", |
| 795 | "wtimeout": 10000 |
| 796 | } |
| 797 | }, |
| 798 | "command_name": "commitTransaction", |
| 799 | "database_name": "admin" |
| 800 | } |
| 801 | } |
| 802 | ], |
| 803 | "outcome": { |
| 804 | "collection": { |
| 805 | "data": [ |
| 806 | { |
| 807 | "_id": 1 |
| 808 | } |
| 809 | ] |
| 810 | } |
| 811 | } |
| 812 | }, |
| 813 | { |
| 814 | "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors", |
| 815 | "failPoint": { |
| 816 | "configureFailPoint": "failCommand", |
| 817 | "mode": { |
| 818 | "times": 2 |
| 819 | }, |
| 820 | "data": { |
| 821 | "failCommands": [ |
| 822 | "commitTransaction" |
| 823 | ], |
| 824 | "errorCode": 11602, |
| 825 | "errorLabels": [ |
| 826 | "RetryableWriteError" |
| 827 | ] |
| 828 | } |
| 829 | }, |
| 830 | "operations": [ |
| 831 | { |
| 832 | "name": "startTransaction", |
| 833 | "object": "session0" |
| 834 | }, |
| 835 | { |
| 836 | "name": "insertOne", |
| 837 | "object": "collection", |
| 838 | "arguments": { |
| 839 | "session": "session0", |
| 840 | "document": { |
| 841 | "_id": 1 |
| 842 | } |
| 843 | }, |
| 844 | "result": { |
| 845 | "insertedId": 1 |
| 846 | } |
| 847 | }, |
| 848 | { |
| 849 | "name": "commitTransaction", |
| 850 | "object": "session0", |
| 851 | "result": { |
| 852 | "errorLabelsContain": [ |
| 853 | "RetryableWriteError", |
| 854 | "UnknownTransactionCommitResult" |
| 855 | ], |
| 856 | "errorLabelsOmit": [ |
| 857 | "TransientTransactionError" |
| 858 | ] |
| 859 | } |
| 860 | }, |
| 861 | { |
| 862 | "name": "commitTransaction", |
| 863 | "object": "session0" |
| 864 | } |
| 865 | ], |
| 866 | "expectations": [ |
| 867 | { |
| 868 | "command_started_event": { |
| 869 | "command": { |
| 870 | "insert": "test", |
| 871 | "documents": [ |
| 872 | { |
| 873 | "_id": 1 |
| 874 | } |
| 875 | ], |
| 876 | "ordered": true, |
| 877 | "readConcern": null, |
| 878 | "lsid": "session0", |
| 879 | "txnNumber": { |
| 880 | "$numberLong": "1" |
| 881 | }, |
| 882 | "startTransaction": true, |
| 883 | "autocommit": false, |
| 884 | "writeConcern": null |
| 885 | }, |
| 886 | "command_name": "insert", |
| 887 | "database_name": "transaction-tests" |
| 888 | } |
| 889 | }, |
| 890 | { |
| 891 | "command_started_event": { |
| 892 | "command": { |
| 893 | "commitTransaction": 1, |
| 894 | "lsid": "session0", |
| 895 | "txnNumber": { |
| 896 | "$numberLong": "1" |
| 897 | }, |
| 898 | "startTransaction": null, |
| 899 | "autocommit": false, |
| 900 | "writeConcern": null |
| 901 | }, |
| 902 | "command_name": "commitTransaction", |
| 903 | "database_name": "admin" |
| 904 | } |
| 905 | }, |
| 906 | { |
| 907 | "command_started_event": { |
| 908 | "command": { |
| 909 | "commitTransaction": 1, |
| 910 | "lsid": "session0", |
| 911 | "txnNumber": { |
| 912 | "$numberLong": "1" |
| 913 | }, |
| 914 | "startTransaction": null, |
| 915 | "autocommit": false, |
| 916 | "writeConcern": { |
| 917 | "w": "majority", |
| 918 | "wtimeout": 10000 |
| 919 | } |
| 920 | }, |
| 921 | "command_name": "commitTransaction", |
| 922 | "database_name": "admin" |
| 923 | } |
| 924 | }, |
| 925 | { |
| 926 | "command_started_event": { |
| 927 | "command": { |
| 928 | "commitTransaction": 1, |
| 929 | "lsid": "session0", |
| 930 | "txnNumber": { |
| 931 | "$numberLong": "1" |
| 932 | }, |
| 933 | "startTransaction": null, |
| 934 | "autocommit": false, |
| 935 | "writeConcern": { |
| 936 | "w": "majority", |
| 937 | "wtimeout": 10000 |
| 938 | } |
| 939 | }, |
| 940 | "command_name": "commitTransaction", |
| 941 | "database_name": "admin" |
| 942 | } |
| 943 | } |
| 944 | ], |
| 945 | "outcome": { |
| 946 | "collection": { |
| 947 | "data": [ |
| 948 | { |
| 949 | "_id": 1 |
| 950 | } |
| 951 | ] |
| 952 | } |
| 953 | } |
| 954 | }, |
| 955 | { |
| 956 | "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress", |
| 957 | "failPoint": { |
| 958 | "configureFailPoint": "failCommand", |
| 959 | "mode": { |
| 960 | "times": 2 |
| 961 | }, |
| 962 | "data": { |
| 963 | "failCommands": [ |
| 964 | "commitTransaction" |
| 965 | ], |
| 966 | "writeConcernError": { |
| 967 | "code": 91, |
| 968 | "errmsg": "Replication is being shut down", |
| 969 | "errorLabels": [ |
| 970 | "RetryableWriteError" |
| 971 | ] |
| 972 | } |
| 973 | } |
| 974 | }, |
| 975 | "operations": [ |
| 976 | { |
| 977 | "name": "startTransaction", |
| 978 | "object": "session0", |
| 979 | "arguments": { |
| 980 | "options": { |
| 981 | "writeConcern": { |
| 982 | "w": "majority" |
| 983 | } |
| 984 | } |
| 985 | } |
| 986 | }, |
| 987 | { |
| 988 | "name": "insertOne", |
| 989 | "object": "collection", |
| 990 | "arguments": { |
| 991 | "session": "session0", |
| 992 | "document": { |
| 993 | "_id": 1 |
| 994 | } |
| 995 | }, |
| 996 | "result": { |
| 997 | "insertedId": 1 |
| 998 | } |
| 999 | }, |
| 1000 | { |
| 1001 | "name": "commitTransaction", |
| 1002 | "object": "session0", |
| 1003 | "result": { |
| 1004 | "errorLabelsContain": [ |
| 1005 | "RetryableWriteError", |
| 1006 | "UnknownTransactionCommitResult" |
| 1007 | ], |
| 1008 | "errorLabelsOmit": [ |
| 1009 | "TransientTransactionError" |
| 1010 | ] |
| 1011 | } |
| 1012 | }, |
| 1013 | { |
| 1014 | "name": "commitTransaction", |
| 1015 | "object": "session0" |
| 1016 | } |
| 1017 | ], |
| 1018 | "expectations": [ |
| 1019 | { |
| 1020 | "command_started_event": { |
| 1021 | "command": { |
| 1022 | "insert": "test", |
| 1023 | "documents": [ |
| 1024 | { |
| 1025 | "_id": 1 |
| 1026 | } |
| 1027 | ], |
| 1028 | "ordered": true, |
| 1029 | "readConcern": null, |
| 1030 | "lsid": "session0", |
| 1031 | "txnNumber": { |
| 1032 | "$numberLong": "1" |
| 1033 | }, |
| 1034 | "startTransaction": true, |
| 1035 | "autocommit": false, |
| 1036 | "writeConcern": null |
| 1037 | }, |
| 1038 | "command_name": "insert", |
| 1039 | "database_name": "transaction-tests" |
| 1040 | } |
| 1041 | }, |
| 1042 | { |
| 1043 | "command_started_event": { |
| 1044 | "command": { |
| 1045 | "commitTransaction": 1, |
| 1046 | "lsid": "session0", |
| 1047 | "txnNumber": { |
| 1048 | "$numberLong": "1" |
| 1049 | }, |
| 1050 | "startTransaction": null, |
| 1051 | "autocommit": false, |
| 1052 | "writeConcern": { |
| 1053 | "w": "majority" |
| 1054 | } |
| 1055 | }, |
| 1056 | "command_name": "commitTransaction", |
| 1057 | "database_name": "admin" |
| 1058 | } |
| 1059 | }, |
| 1060 | { |
| 1061 | "command_started_event": { |
| 1062 | "command": { |
| 1063 | "commitTransaction": 1, |
| 1064 | "lsid": "session0", |
| 1065 | "txnNumber": { |
| 1066 | "$numberLong": "1" |
| 1067 | }, |
| 1068 | "startTransaction": null, |
| 1069 | "autocommit": false, |
| 1070 | "writeConcern": { |
| 1071 | "w": "majority", |
| 1072 | "wtimeout": 10000 |
| 1073 | } |
| 1074 | }, |
| 1075 | "command_name": "commitTransaction", |
| 1076 | "database_name": "admin" |
| 1077 | } |
| 1078 | }, |
| 1079 | { |
| 1080 | "command_started_event": { |
| 1081 | "command": { |
| 1082 | "commitTransaction": 1, |
| 1083 | "lsid": "session0", |
| 1084 | "txnNumber": { |
| 1085 | "$numberLong": "1" |
| 1086 | }, |
| 1087 | "startTransaction": null, |
| 1088 | "autocommit": false, |
| 1089 | "writeConcern": { |
| 1090 | "w": "majority", |
| 1091 | "wtimeout": 10000 |
| 1092 | } |
| 1093 | }, |
| 1094 | "command_name": "commitTransaction", |
| 1095 | "database_name": "admin" |
| 1096 | } |
| 1097 | } |
| 1098 | ], |
| 1099 | "outcome": { |
| 1100 | "collection": { |
| 1101 | "data": [ |
| 1102 | { |
| 1103 | "_id": 1 |
| 1104 | } |
| 1105 | ] |
| 1106 | } |
| 1107 | } |
| 1108 | }, |
| 1109 | { |
| 1110 | "description": "do not add RetryableWriteError label to writeConcernError ShutdownInProgress that occurs within transaction", |
| 1111 | "failPoint": { |
| 1112 | "configureFailPoint": "failCommand", |
| 1113 | "mode": { |
| 1114 | "times": 1 |
| 1115 | }, |
| 1116 | "data": { |
| 1117 | "failCommands": [ |
| 1118 | "insert" |
| 1119 | ], |
| 1120 | "writeConcernError": { |
| 1121 | "code": 91, |
| 1122 | "errmsg": "Replication is being shut down" |
| 1123 | } |
| 1124 | } |
| 1125 | }, |
| 1126 | "operations": [ |
| 1127 | { |
| 1128 | "name": "startTransaction", |
| 1129 | "object": "session0", |
| 1130 | "arguments": { |
| 1131 | "options": { |
| 1132 | "writeConcern": { |
| 1133 | "w": "majority" |
| 1134 | } |
| 1135 | } |
| 1136 | } |
| 1137 | }, |
| 1138 | { |
| 1139 | "name": "insertOne", |
| 1140 | "object": "collection", |
| 1141 | "arguments": { |
| 1142 | "session": "session0", |
| 1143 | "document": { |
| 1144 | "_id": 1 |
| 1145 | } |
| 1146 | }, |
| 1147 | "result": { |
| 1148 | "errorLabelsContain": [], |
| 1149 | "errorLabelsOmit": [ |
| 1150 | "RetryableWriteError", |
| 1151 | "TransientTransactionError", |
| 1152 | "UnknownTransactionCommitResult" |
| 1153 | ] |
| 1154 | } |
| 1155 | }, |
| 1156 | { |
| 1157 | "name": "abortTransaction", |
| 1158 | "object": "session0" |
| 1159 | } |
| 1160 | ], |
| 1161 | "expectations": [ |
| 1162 | { |
| 1163 | "command_started_event": { |
| 1164 | "command": { |
| 1165 | "insert": "test", |
| 1166 | "documents": [ |
| 1167 | { |
| 1168 | "_id": 1 |
| 1169 | } |
| 1170 | ], |
| 1171 | "ordered": true, |
| 1172 | "readConcern": null, |
| 1173 | "lsid": "session0", |
| 1174 | "txnNumber": { |
| 1175 | "$numberLong": "1" |
| 1176 | }, |
| 1177 | "startTransaction": true, |
| 1178 | "autocommit": false |
| 1179 | }, |
| 1180 | "command_name": "insert", |
| 1181 | "database_name": "transaction-tests" |
| 1182 | } |
| 1183 | }, |
| 1184 | { |
| 1185 | "command_started_event": { |
| 1186 | "command": { |
| 1187 | "abortTransaction": 1, |
| 1188 | "lsid": "session0", |
| 1189 | "txnNumber": { |
| 1190 | "$numberLong": "1" |
| 1191 | }, |
| 1192 | "startTransaction": null, |
| 1193 | "autocommit": false |
| 1194 | }, |
| 1195 | "command_name": "abortTransaction", |
| 1196 | "database_name": "admin" |
| 1197 | } |
| 1198 | } |
| 1199 | ], |
| 1200 | "outcome": { |
| 1201 | "collection": { |
| 1202 | "data": [] |
| 1203 | } |
| 1204 | } |
| 1205 | }, |
| 1206 | { |
| 1207 | "description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed", |
| 1208 | "failPoint": { |
| 1209 | "configureFailPoint": "failCommand", |
| 1210 | "mode": { |
| 1211 | "times": 1 |
| 1212 | }, |
| 1213 | "data": { |
| 1214 | "failCommands": [ |
| 1215 | "commitTransaction" |
| 1216 | ], |
| 1217 | "writeConcernError": { |
| 1218 | "code": 64, |
| 1219 | "errmsg": "multiple errors reported" |
| 1220 | } |
| 1221 | } |
| 1222 | }, |
| 1223 | "operations": [ |
| 1224 | { |
| 1225 | "name": "startTransaction", |
| 1226 | "object": "session0", |
| 1227 | "arguments": { |
| 1228 | "options": { |
| 1229 | "writeConcern": { |
| 1230 | "w": "majority" |
| 1231 | } |
| 1232 | } |
| 1233 | } |
| 1234 | }, |
| 1235 | { |
| 1236 | "name": "insertOne", |
| 1237 | "object": "collection", |
| 1238 | "arguments": { |
| 1239 | "session": "session0", |
| 1240 | "document": { |
| 1241 | "_id": 1 |
| 1242 | } |
| 1243 | }, |
| 1244 | "result": { |
| 1245 | "insertedId": 1 |
| 1246 | } |
| 1247 | }, |
| 1248 | { |
| 1249 | "name": "commitTransaction", |
| 1250 | "object": "session0", |
| 1251 | "result": { |
| 1252 | "errorLabelsContain": [ |
| 1253 | "UnknownTransactionCommitResult" |
| 1254 | ], |
| 1255 | "errorLabelsOmit": [ |
| 1256 | "RetryableWriteError", |
| 1257 | "TransientTransactionError" |
| 1258 | ] |
| 1259 | } |
| 1260 | }, |
| 1261 | { |
| 1262 | "name": "commitTransaction", |
| 1263 | "object": "session0" |
| 1264 | } |
| 1265 | ], |
| 1266 | "expectations": [ |
| 1267 | { |
| 1268 | "command_started_event": { |
| 1269 | "command": { |
| 1270 | "insert": "test", |
| 1271 | "documents": [ |
| 1272 | { |
| 1273 | "_id": 1 |
| 1274 | } |
| 1275 | ], |
| 1276 | "ordered": true, |
| 1277 | "readConcern": null, |
| 1278 | "lsid": "session0", |
| 1279 | "txnNumber": { |
| 1280 | "$numberLong": "1" |
| 1281 | }, |
| 1282 | "startTransaction": true, |
| 1283 | "autocommit": false, |
| 1284 | "writeConcern": null |
| 1285 | }, |
| 1286 | "command_name": "insert", |
| 1287 | "database_name": "transaction-tests" |
| 1288 | } |
| 1289 | }, |
| 1290 | { |
| 1291 | "command_started_event": { |
| 1292 | "command": { |
| 1293 | "commitTransaction": 1, |
| 1294 | "lsid": "session0", |
| 1295 | "txnNumber": { |
| 1296 | "$numberLong": "1" |
| 1297 | }, |
| 1298 | "startTransaction": null, |
| 1299 | "autocommit": false, |
| 1300 | "writeConcern": { |
| 1301 | "w": "majority" |
| 1302 | } |
| 1303 | }, |
| 1304 | "command_name": "commitTransaction", |
| 1305 | "database_name": "admin" |
| 1306 | } |
| 1307 | }, |
| 1308 | { |
| 1309 | "command_started_event": { |
| 1310 | "command": { |
| 1311 | "commitTransaction": 1, |
| 1312 | "lsid": "session0", |
| 1313 | "txnNumber": { |
| 1314 | "$numberLong": "1" |
| 1315 | }, |
| 1316 | "startTransaction": null, |
| 1317 | "autocommit": false, |
| 1318 | "writeConcern": { |
| 1319 | "w": "majority", |
| 1320 | "wtimeout": 10000 |
| 1321 | } |
| 1322 | }, |
| 1323 | "command_name": "commitTransaction", |
| 1324 | "database_name": "admin" |
| 1325 | } |
| 1326 | } |
| 1327 | ], |
| 1328 | "outcome": { |
| 1329 | "collection": { |
| 1330 | "data": [ |
| 1331 | { |
| 1332 | "_id": 1 |
| 1333 | } |
| 1334 | ] |
| 1335 | } |
| 1336 | } |
| 1337 | }, |
| 1338 | { |
| 1339 | "description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout", |
| 1340 | "failPoint": { |
| 1341 | "configureFailPoint": "failCommand", |
| 1342 | "mode": { |
| 1343 | "times": 1 |
| 1344 | }, |
| 1345 | "data": { |
| 1346 | "failCommands": [ |
| 1347 | "commitTransaction" |
| 1348 | ], |
| 1349 | "writeConcernError": { |
| 1350 | "code": 64, |
| 1351 | "codeName": "WriteConcernFailed", |
| 1352 | "errmsg": "waiting for replication timed out", |
| 1353 | "errInfo": { |
| 1354 | "wtimeout": true |
| 1355 | } |
| 1356 | } |
| 1357 | } |
| 1358 | }, |
| 1359 | "operations": [ |
| 1360 | { |
| 1361 | "name": "startTransaction", |
| 1362 | "object": "session0", |
| 1363 | "arguments": { |
| 1364 | "options": { |
| 1365 | "writeConcern": { |
| 1366 | "w": "majority" |
| 1367 | } |
| 1368 | } |
| 1369 | } |
| 1370 | }, |
| 1371 | { |
| 1372 | "name": "insertOne", |
| 1373 | "object": "collection", |
| 1374 | "arguments": { |
| 1375 | "session": "session0", |
| 1376 | "document": { |
| 1377 | "_id": 1 |
| 1378 | } |
| 1379 | }, |
| 1380 | "result": { |
| 1381 | "insertedId": 1 |
| 1382 | } |
| 1383 | }, |
| 1384 | { |
| 1385 | "name": "commitTransaction", |
| 1386 | "object": "session0", |
| 1387 | "result": { |
| 1388 | "errorLabelsContain": [ |
| 1389 | "UnknownTransactionCommitResult" |
| 1390 | ], |
| 1391 | "errorLabelsOmit": [ |
| 1392 | "RetryableWriteError", |
| 1393 | "TransientTransactionError" |
| 1394 | ] |
| 1395 | } |
| 1396 | }, |
| 1397 | { |
| 1398 | "name": "commitTransaction", |
| 1399 | "object": "session0" |
| 1400 | } |
| 1401 | ], |
| 1402 | "expectations": [ |
| 1403 | { |
| 1404 | "command_started_event": { |
| 1405 | "command": { |
| 1406 | "insert": "test", |
| 1407 | "documents": [ |
| 1408 | { |
| 1409 | "_id": 1 |
| 1410 | } |
| 1411 | ], |
| 1412 | "ordered": true, |
| 1413 | "readConcern": null, |
| 1414 | "lsid": "session0", |
| 1415 | "txnNumber": { |
| 1416 | "$numberLong": "1" |
| 1417 | }, |
| 1418 | "startTransaction": true, |
| 1419 | "autocommit": false, |
| 1420 | "writeConcern": null |
| 1421 | }, |
| 1422 | "command_name": "insert", |
| 1423 | "database_name": "transaction-tests" |
| 1424 | } |
| 1425 | }, |
| 1426 | { |
| 1427 | "command_started_event": { |
| 1428 | "command": { |
| 1429 | "commitTransaction": 1, |
| 1430 | "lsid": "session0", |
| 1431 | "txnNumber": { |
| 1432 | "$numberLong": "1" |
| 1433 | }, |
| 1434 | "startTransaction": null, |
| 1435 | "autocommit": false, |
| 1436 | "writeConcern": { |
| 1437 | "w": "majority" |
| 1438 | } |
| 1439 | }, |
| 1440 | "command_name": "commitTransaction", |
| 1441 | "database_name": "admin" |
| 1442 | } |
| 1443 | }, |
| 1444 | { |
| 1445 | "command_started_event": { |
| 1446 | "command": { |
| 1447 | "commitTransaction": 1, |
| 1448 | "lsid": "session0", |
| 1449 | "txnNumber": { |
| 1450 | "$numberLong": "1" |
| 1451 | }, |
| 1452 | "startTransaction": null, |
| 1453 | "autocommit": false, |
| 1454 | "writeConcern": { |
| 1455 | "w": "majority", |
| 1456 | "wtimeout": 10000 |
| 1457 | } |
| 1458 | }, |
| 1459 | "command_name": "commitTransaction", |
| 1460 | "database_name": "admin" |
| 1461 | } |
| 1462 | } |
| 1463 | ], |
| 1464 | "outcome": { |
| 1465 | "collection": { |
| 1466 | "data": [ |
| 1467 | { |
| 1468 | "_id": 1 |
| 1469 | } |
| 1470 | ] |
| 1471 | } |
| 1472 | } |
| 1473 | }, |
| 1474 | { |
| 1475 | "description": "omit UnknownTransactionCommitResult label from writeConcernError UnsatisfiableWriteConcern", |
| 1476 | "failPoint": { |
| 1477 | "configureFailPoint": "failCommand", |
| 1478 | "mode": { |
| 1479 | "times": 1 |
| 1480 | }, |
| 1481 | "data": { |
| 1482 | "failCommands": [ |
| 1483 | "commitTransaction" |
| 1484 | ], |
| 1485 | "writeConcernError": { |
| 1486 | "code": 100, |
| 1487 | "errmsg": "Not enough data-bearing nodes" |
| 1488 | } |
| 1489 | } |
| 1490 | }, |
| 1491 | "operations": [ |
| 1492 | { |
| 1493 | "name": "startTransaction", |
| 1494 | "object": "session0", |
| 1495 | "arguments": { |
| 1496 | "options": { |
| 1497 | "writeConcern": { |
| 1498 | "w": "majority" |
| 1499 | } |
| 1500 | } |
| 1501 | } |
| 1502 | }, |
| 1503 | { |
| 1504 | "name": "insertOne", |
| 1505 | "object": "collection", |
| 1506 | "arguments": { |
| 1507 | "session": "session0", |
| 1508 | "document": { |
| 1509 | "_id": 1 |
| 1510 | } |
| 1511 | }, |
| 1512 | "result": { |
| 1513 | "insertedId": 1 |
| 1514 | } |
| 1515 | }, |
| 1516 | { |
| 1517 | "name": "commitTransaction", |
| 1518 | "object": "session0", |
| 1519 | "result": { |
| 1520 | "errorLabelsOmit": [ |
| 1521 | "RetryableWriteError", |
| 1522 | "TransientTransactionError", |
| 1523 | "UnknownTransactionCommitResult" |
| 1524 | ] |
| 1525 | } |
| 1526 | } |
| 1527 | ], |
| 1528 | "expectations": [ |
| 1529 | { |
| 1530 | "command_started_event": { |
| 1531 | "command": { |
| 1532 | "insert": "test", |
| 1533 | "documents": [ |
| 1534 | { |
| 1535 | "_id": 1 |
| 1536 | } |
| 1537 | ], |
| 1538 | "ordered": true, |
| 1539 | "readConcern": null, |
| 1540 | "lsid": "session0", |
| 1541 | "txnNumber": { |
| 1542 | "$numberLong": "1" |
| 1543 | }, |
| 1544 | "startTransaction": true, |
| 1545 | "autocommit": false, |
| 1546 | "writeConcern": null |
| 1547 | }, |
| 1548 | "command_name": "insert", |
| 1549 | "database_name": "transaction-tests" |
| 1550 | } |
| 1551 | }, |
| 1552 | { |
| 1553 | "command_started_event": { |
| 1554 | "command": { |
| 1555 | "commitTransaction": 1, |
| 1556 | "lsid": "session0", |
| 1557 | "txnNumber": { |
| 1558 | "$numberLong": "1" |
| 1559 | }, |
| 1560 | "startTransaction": null, |
| 1561 | "autocommit": false, |
| 1562 | "writeConcern": { |
| 1563 | "w": "majority" |
| 1564 | } |
| 1565 | }, |
| 1566 | "command_name": "commitTransaction", |
| 1567 | "database_name": "admin" |
| 1568 | } |
| 1569 | } |
| 1570 | ], |
| 1571 | "outcome": { |
| 1572 | "collection": { |
| 1573 | "data": [ |
| 1574 | { |
| 1575 | "_id": 1 |
| 1576 | } |
| 1577 | ] |
| 1578 | } |
| 1579 | } |
| 1580 | }, |
| 1581 | { |
| 1582 | "description": "omit UnknownTransactionCommitResult label from writeConcernError UnknownReplWriteConcern", |
| 1583 | "failPoint": { |
| 1584 | "configureFailPoint": "failCommand", |
| 1585 | "mode": { |
| 1586 | "times": 1 |
| 1587 | }, |
| 1588 | "data": { |
| 1589 | "failCommands": [ |
| 1590 | "commitTransaction" |
| 1591 | ], |
| 1592 | "writeConcernError": { |
| 1593 | "code": 79, |
| 1594 | "errmsg": "No write concern mode named 'blah' found in replica set configuration" |
| 1595 | } |
| 1596 | } |
| 1597 | }, |
| 1598 | "operations": [ |
| 1599 | { |
| 1600 | "name": "startTransaction", |
| 1601 | "object": "session0", |
| 1602 | "arguments": { |
| 1603 | "options": { |
| 1604 | "writeConcern": { |
| 1605 | "w": "majority" |
| 1606 | } |
| 1607 | } |
| 1608 | } |
| 1609 | }, |
| 1610 | { |
| 1611 | "name": "insertOne", |
| 1612 | "object": "collection", |
| 1613 | "arguments": { |
| 1614 | "session": "session0", |
| 1615 | "document": { |
| 1616 | "_id": 1 |
| 1617 | } |
| 1618 | }, |
| 1619 | "result": { |
| 1620 | "insertedId": 1 |
| 1621 | } |
| 1622 | }, |
| 1623 | { |
| 1624 | "name": "commitTransaction", |
| 1625 | "object": "session0", |
| 1626 | "result": { |
| 1627 | "errorLabelsOmit": [ |
| 1628 | "RetryableWriteConcern", |
| 1629 | "TransientTransactionError", |
| 1630 | "UnknownTransactionCommitResult" |
| 1631 | ] |
| 1632 | } |
| 1633 | } |
| 1634 | ], |
| 1635 | "expectations": [ |
| 1636 | { |
| 1637 | "command_started_event": { |
| 1638 | "command": { |
| 1639 | "insert": "test", |
| 1640 | "documents": [ |
| 1641 | { |
| 1642 | "_id": 1 |
| 1643 | } |
| 1644 | ], |
| 1645 | "ordered": true, |
| 1646 | "readConcern": null, |
| 1647 | "lsid": "session0", |
| 1648 | "txnNumber": { |
| 1649 | "$numberLong": "1" |
| 1650 | }, |
| 1651 | "startTransaction": true, |
| 1652 | "autocommit": false, |
| 1653 | "writeConcern": null |
| 1654 | }, |
| 1655 | "command_name": "insert", |
| 1656 | "database_name": "transaction-tests" |
| 1657 | } |
| 1658 | }, |
| 1659 | { |
| 1660 | "command_started_event": { |
| 1661 | "command": { |
| 1662 | "commitTransaction": 1, |
| 1663 | "lsid": "session0", |
| 1664 | "txnNumber": { |
| 1665 | "$numberLong": "1" |
| 1666 | }, |
| 1667 | "startTransaction": null, |
| 1668 | "autocommit": false, |
| 1669 | "writeConcern": { |
| 1670 | "w": "majority" |
| 1671 | } |
| 1672 | }, |
| 1673 | "command_name": "commitTransaction", |
| 1674 | "database_name": "admin" |
| 1675 | } |
| 1676 | } |
| 1677 | ], |
| 1678 | "outcome": { |
| 1679 | "collection": { |
| 1680 | "data": [ |
| 1681 | { |
| 1682 | "_id": 1 |
| 1683 | } |
| 1684 | ] |
| 1685 | } |
| 1686 | } |
| 1687 | }, |
| 1688 | { |
| 1689 | "description": "do not add UnknownTransactionCommitResult label to MaxTimeMSExpired inside transactions", |
| 1690 | "failPoint": { |
| 1691 | "configureFailPoint": "failCommand", |
| 1692 | "mode": { |
| 1693 | "times": 1 |
| 1694 | }, |
| 1695 | "data": { |
| 1696 | "failCommands": [ |
| 1697 | "aggregate" |
| 1698 | ], |
| 1699 | "errorCode": 50 |
| 1700 | } |
| 1701 | }, |
| 1702 | "operations": [ |
| 1703 | { |
| 1704 | "name": "startTransaction", |
| 1705 | "object": "session0" |
| 1706 | }, |
| 1707 | { |
| 1708 | "name": "insertOne", |
| 1709 | "object": "collection", |
| 1710 | "arguments": { |
| 1711 | "session": "session0", |
| 1712 | "document": { |
| 1713 | "_id": 1 |
| 1714 | } |
| 1715 | }, |
| 1716 | "result": { |
| 1717 | "insertedId": 1 |
| 1718 | } |
| 1719 | }, |
| 1720 | { |
| 1721 | "name": "aggregate", |
| 1722 | "object": "collection", |
| 1723 | "arguments": { |
| 1724 | "pipeline": [ |
| 1725 | { |
| 1726 | "$project": { |
| 1727 | "_id": 1 |
| 1728 | } |
| 1729 | } |
| 1730 | ], |
| 1731 | "maxTimeMS": 60000, |
| 1732 | "session": "session0" |
| 1733 | }, |
| 1734 | "result": { |
| 1735 | "errorLabelsOmit": [ |
| 1736 | "RetryableWriteError", |
| 1737 | "UnknownTransactionCommitResult", |
| 1738 | "TransientTransactionError" |
| 1739 | ] |
| 1740 | } |
| 1741 | }, |
| 1742 | { |
| 1743 | "name": "abortTransaction", |
| 1744 | "object": "session0" |
| 1745 | } |
| 1746 | ], |
| 1747 | "expectations": [ |
| 1748 | { |
| 1749 | "command_started_event": { |
| 1750 | "command": { |
| 1751 | "insert": "test", |
| 1752 | "documents": [ |
| 1753 | { |
| 1754 | "_id": 1 |
| 1755 | } |
| 1756 | ], |
| 1757 | "ordered": true, |
| 1758 | "readConcern": null, |
| 1759 | "lsid": "session0", |
| 1760 | "txnNumber": { |
| 1761 | "$numberLong": "1" |
| 1762 | }, |
| 1763 | "startTransaction": true, |
| 1764 | "autocommit": false, |
| 1765 | "writeConcern": null |
| 1766 | }, |
| 1767 | "command_name": "insert", |
| 1768 | "database_name": "transaction-tests" |
| 1769 | } |
| 1770 | }, |
| 1771 | { |
| 1772 | "command_started_event": { |
| 1773 | "command": { |
| 1774 | "aggregate": "test", |
| 1775 | "pipeline": [ |
| 1776 | { |
| 1777 | "$project": { |
| 1778 | "_id": 1 |
| 1779 | } |
| 1780 | } |
| 1781 | ], |
| 1782 | "cursor": {}, |
| 1783 | "readConcern": null, |
| 1784 | "lsid": "session0", |
| 1785 | "txnNumber": { |
| 1786 | "$numberLong": "1" |
| 1787 | }, |
| 1788 | "autocommit": false, |
| 1789 | "maxTimeMS": 60000 |
| 1790 | }, |
| 1791 | "command_name": "aggregate", |
| 1792 | "database_name": "transaction-tests" |
| 1793 | } |
| 1794 | }, |
| 1795 | { |
| 1796 | "command_started_event": { |
| 1797 | "command": { |
| 1798 | "abortTransaction": 1, |
| 1799 | "lsid": "session0", |
| 1800 | "txnNumber": { |
| 1801 | "$numberLong": "1" |
| 1802 | }, |
| 1803 | "startTransaction": null, |
| 1804 | "autocommit": false, |
| 1805 | "writeConcern": null |
| 1806 | }, |
| 1807 | "command_name": "abortTransaction", |
| 1808 | "database_name": "admin" |
| 1809 | } |
| 1810 | } |
| 1811 | ], |
| 1812 | "outcome": { |
| 1813 | "collection": { |
| 1814 | "data": [] |
| 1815 | } |
| 1816 | } |
| 1817 | }, |
| 1818 | { |
| 1819 | "description": "add UnknownTransactionCommitResult label to MaxTimeMSExpired", |
| 1820 | "failPoint": { |
| 1821 | "configureFailPoint": "failCommand", |
| 1822 | "mode": { |
| 1823 | "times": 1 |
| 1824 | }, |
| 1825 | "data": { |
| 1826 | "failCommands": [ |
| 1827 | "commitTransaction" |
| 1828 | ], |
| 1829 | "errorCode": 50 |
| 1830 | } |
| 1831 | }, |
| 1832 | "operations": [ |
| 1833 | { |
| 1834 | "name": "startTransaction", |
| 1835 | "object": "session0", |
| 1836 | "arguments": { |
| 1837 | "options": { |
| 1838 | "writeConcern": { |
| 1839 | "w": "majority" |
| 1840 | }, |
| 1841 | "maxCommitTimeMS": 60000 |
| 1842 | } |
| 1843 | } |
| 1844 | }, |
| 1845 | { |
| 1846 | "name": "insertOne", |
| 1847 | "object": "collection", |
| 1848 | "arguments": { |
| 1849 | "session": "session0", |
| 1850 | "document": { |
| 1851 | "_id": 1 |
| 1852 | } |
| 1853 | }, |
| 1854 | "result": { |
| 1855 | "insertedId": 1 |
| 1856 | } |
| 1857 | }, |
| 1858 | { |
| 1859 | "name": "commitTransaction", |
| 1860 | "object": "session0", |
| 1861 | "result": { |
| 1862 | "errorLabelsContain": [ |
| 1863 | "UnknownTransactionCommitResult" |
| 1864 | ], |
| 1865 | "errorLabelsOmit": [ |
| 1866 | "RetryableWriteError", |
| 1867 | "TransientTransactionError" |
| 1868 | ] |
| 1869 | } |
| 1870 | }, |
| 1871 | { |
| 1872 | "name": "commitTransaction", |
| 1873 | "object": "session0" |
| 1874 | } |
| 1875 | ], |
| 1876 | "expectations": [ |
| 1877 | { |
| 1878 | "command_started_event": { |
| 1879 | "command": { |
| 1880 | "insert": "test", |
| 1881 | "documents": [ |
| 1882 | { |
| 1883 | "_id": 1 |
| 1884 | } |
| 1885 | ], |
| 1886 | "ordered": true, |
| 1887 | "readConcern": null, |
| 1888 | "lsid": "session0", |
| 1889 | "txnNumber": { |
| 1890 | "$numberLong": "1" |
| 1891 | }, |
| 1892 | "startTransaction": true, |
| 1893 | "autocommit": false, |
| 1894 | "writeConcern": null |
| 1895 | }, |
| 1896 | "command_name": "insert", |
| 1897 | "database_name": "transaction-tests" |
| 1898 | } |
| 1899 | }, |
| 1900 | { |
| 1901 | "command_started_event": { |
| 1902 | "command": { |
| 1903 | "commitTransaction": 1, |
| 1904 | "lsid": "session0", |
| 1905 | "txnNumber": { |
| 1906 | "$numberLong": "1" |
| 1907 | }, |
| 1908 | "startTransaction": null, |
| 1909 | "autocommit": false, |
| 1910 | "writeConcern": { |
| 1911 | "w": "majority" |
| 1912 | }, |
| 1913 | "maxTimeMS": 60000 |
| 1914 | }, |
| 1915 | "command_name": "commitTransaction", |
| 1916 | "database_name": "admin" |
| 1917 | } |
| 1918 | }, |
| 1919 | { |
| 1920 | "command_started_event": { |
| 1921 | "command": { |
| 1922 | "commitTransaction": 1, |
| 1923 | "lsid": "session0", |
| 1924 | "txnNumber": { |
| 1925 | "$numberLong": "1" |
| 1926 | }, |
| 1927 | "startTransaction": null, |
| 1928 | "autocommit": false, |
| 1929 | "writeConcern": { |
| 1930 | "w": "majority", |
| 1931 | "wtimeout": 10000 |
| 1932 | }, |
| 1933 | "maxTimeMS": 60000 |
| 1934 | }, |
| 1935 | "command_name": "commitTransaction", |
| 1936 | "database_name": "admin" |
| 1937 | } |
| 1938 | } |
| 1939 | ], |
| 1940 | "outcome": { |
| 1941 | "collection": { |
| 1942 | "data": [ |
| 1943 | { |
| 1944 | "_id": 1 |
| 1945 | } |
| 1946 | ] |
| 1947 | } |
| 1948 | } |
| 1949 | }, |
| 1950 | { |
| 1951 | "description": "add UnknownTransactionCommitResult label to writeConcernError MaxTimeMSExpired", |
| 1952 | "failPoint": { |
| 1953 | "configureFailPoint": "failCommand", |
| 1954 | "mode": { |
| 1955 | "times": 1 |
| 1956 | }, |
| 1957 | "data": { |
| 1958 | "failCommands": [ |
| 1959 | "commitTransaction" |
| 1960 | ], |
| 1961 | "writeConcernError": { |
| 1962 | "code": 50, |
| 1963 | "errmsg": "operation exceeded time limit" |
| 1964 | } |
| 1965 | } |
| 1966 | }, |
| 1967 | "operations": [ |
| 1968 | { |
| 1969 | "name": "startTransaction", |
| 1970 | "object": "session0", |
| 1971 | "arguments": { |
| 1972 | "options": { |
| 1973 | "writeConcern": { |
| 1974 | "w": "majority" |
| 1975 | }, |
| 1976 | "maxCommitTimeMS": 60000 |
| 1977 | } |
| 1978 | } |
| 1979 | }, |
| 1980 | { |
| 1981 | "name": "insertOne", |
| 1982 | "object": "collection", |
| 1983 | "arguments": { |
| 1984 | "session": "session0", |
| 1985 | "document": { |
| 1986 | "_id": 1 |
| 1987 | } |
| 1988 | }, |
| 1989 | "result": { |
| 1990 | "insertedId": 1 |
| 1991 | } |
| 1992 | }, |
| 1993 | { |
| 1994 | "name": "commitTransaction", |
| 1995 | "object": "session0", |
| 1996 | "result": { |
| 1997 | "errorLabelsContain": [ |
| 1998 | "UnknownTransactionCommitResult" |
| 1999 | ], |
| 2000 | "errorLabelsOmit": [ |
| 2001 | "RetryableWriteError", |
| 2002 | "TransientTransactionError" |
| 2003 | ] |
| 2004 | } |
| 2005 | }, |
| 2006 | { |
| 2007 | "name": "commitTransaction", |
| 2008 | "object": "session0" |
| 2009 | } |
| 2010 | ], |
| 2011 | "expectations": [ |
| 2012 | { |
| 2013 | "command_started_event": { |
| 2014 | "command": { |
| 2015 | "insert": "test", |
| 2016 | "documents": [ |
| 2017 | { |
| 2018 | "_id": 1 |
| 2019 | } |
| 2020 | ], |
| 2021 | "ordered": true, |
| 2022 | "readConcern": null, |
| 2023 | "lsid": "session0", |
| 2024 | "txnNumber": { |
| 2025 | "$numberLong": "1" |
| 2026 | }, |
| 2027 | "startTransaction": true, |
| 2028 | "autocommit": false, |
| 2029 | "writeConcern": null |
| 2030 | }, |
| 2031 | "command_name": "insert", |
| 2032 | "database_name": "transaction-tests" |
| 2033 | } |
| 2034 | }, |
| 2035 | { |
| 2036 | "command_started_event": { |
| 2037 | "command": { |
| 2038 | "commitTransaction": 1, |
| 2039 | "lsid": "session0", |
| 2040 | "txnNumber": { |
| 2041 | "$numberLong": "1" |
| 2042 | }, |
| 2043 | "startTransaction": null, |
| 2044 | "autocommit": false, |
| 2045 | "writeConcern": { |
| 2046 | "w": "majority" |
| 2047 | }, |
| 2048 | "maxTimeMS": 60000 |
| 2049 | }, |
| 2050 | "command_name": "commitTransaction", |
| 2051 | "database_name": "admin" |
| 2052 | } |
| 2053 | }, |
| 2054 | { |
| 2055 | "command_started_event": { |
| 2056 | "command": { |
| 2057 | "commitTransaction": 1, |
| 2058 | "lsid": "session0", |
| 2059 | "txnNumber": { |
| 2060 | "$numberLong": "1" |
| 2061 | }, |
| 2062 | "startTransaction": null, |
| 2063 | "autocommit": false, |
| 2064 | "writeConcern": { |
| 2065 | "w": "majority", |
| 2066 | "wtimeout": 10000 |
| 2067 | }, |
| 2068 | "maxTimeMS": 60000 |
| 2069 | }, |
| 2070 | "command_name": "commitTransaction", |
| 2071 | "database_name": "admin" |
| 2072 | } |
| 2073 | } |
| 2074 | ], |
| 2075 | "outcome": { |
| 2076 | "collection": { |
| 2077 | "data": [ |
| 2078 | { |
| 2079 | "_id": 1 |
| 2080 | } |
| 2081 | ] |
| 2082 | } |
| 2083 | } |
| 2084 | } |
| 2085 | ] |
| 2086 | } |