1{ 2 "runOn": [ 3 { 4 "minServerVersion": "4.0", 5 "topology": [ 6 "single", 7 "replicaset" 8 ] 9 }, 10 { 11 "minServerVersion": "4.1.7", 12 "topology": [ 13 "sharded" 14 ] 15 } 16 ], 17 "database_name": "retryable-reads-tests", 18 "collection_name": "coll", 19 "data": [ 20 { 21 "_id": 1, 22 "x": 11 23 }, 24 { 25 "_id": 2, 26 "x": 22 27 }, 28 { 29 "_id": 3, 30 "x": 33 31 }, 32 { 33 "_id": 4, 34 "x": 44 35 }, 36 { 37 "_id": 5, 38 "x": 55 39 } 40 ], 41 "tests": [ 42 { 43 "description": "FindOne succeeds after InterruptedAtShutdown", 44 "failPoint": { 45 "configureFailPoint": "failCommand", 46 "mode": { 47 "times": 1 48 }, 49 "data": { 50 "failCommands": [ 51 "find" 52 ], 53 "errorCode": 11600 54 } 55 }, 56 "operations": [ 57 { 58 "name": "findOne", 59 "object": "collection", 60 "arguments": { 61 "filter": { 62 "_id": 1 63 } 64 }, 65 "result": { 66 "_id": 1, 67 "x": 11 68 } 69 } 70 ], 71 "expectations": [ 72 { 73 "command_started_event": { 74 "command": { 75 "find": "coll", 76 "filter": { 77 "_id": 1 78 } 79 }, 80 "database_name": "retryable-reads-tests" 81 } 82 }, 83 { 84 "command_started_event": { 85 "command": { 86 "find": "coll", 87 "filter": { 88 "_id": 1 89 } 90 }, 91 "database_name": "retryable-reads-tests" 92 } 93 } 94 ] 95 }, 96 { 97 "description": "FindOne succeeds after InterruptedDueToReplStateChange", 98 "failPoint": { 99 "configureFailPoint": "failCommand", 100 "mode": { 101 "times": 1 102 }, 103 "data": { 104 "failCommands": [ 105 "find" 106 ], 107 "errorCode": 11602 108 } 109 }, 110 "operations": [ 111 { 112 "name": "findOne", 113 "object": "collection", 114 "arguments": { 115 "filter": { 116 "_id": 1 117 } 118 }, 119 "result": { 120 "_id": 1, 121 "x": 11 122 } 123 } 124 ], 125 "expectations": [ 126 { 127 "command_started_event": { 128 "command": { 129 "find": "coll", 130 "filter": { 131 "_id": 1 132 } 133 }, 134 "database_name": "retryable-reads-tests" 135 } 136 }, 137 { 138 "command_started_event": { 139 "command": { 140 "find": "coll", 141 "filter": { 142 "_id": 1 143 } 144 }, 145 "database_name": "retryable-reads-tests" 146 } 147 } 148 ] 149 }, 150 { 151 "description": "FindOne succeeds after NotMaster", 152 "failPoint": { 153 "configureFailPoint": "failCommand", 154 "mode": { 155 "times": 1 156 }, 157 "data": { 158 "failCommands": [ 159 "find" 160 ], 161 "errorCode": 10107 162 } 163 }, 164 "operations": [ 165 { 166 "name": "findOne", 167 "object": "collection", 168 "arguments": { 169 "filter": { 170 "_id": 1 171 } 172 }, 173 "result": { 174 "_id": 1, 175 "x": 11 176 } 177 } 178 ], 179 "expectations": [ 180 { 181 "command_started_event": { 182 "command": { 183 "find": "coll", 184 "filter": { 185 "_id": 1 186 } 187 }, 188 "database_name": "retryable-reads-tests" 189 } 190 }, 191 { 192 "command_started_event": { 193 "command": { 194 "find": "coll", 195 "filter": { 196 "_id": 1 197 } 198 }, 199 "database_name": "retryable-reads-tests" 200 } 201 } 202 ] 203 }, 204 { 205 "description": "FindOne succeeds after NotMasterNoSlaveOk", 206 "failPoint": { 207 "configureFailPoint": "failCommand", 208 "mode": { 209 "times": 1 210 }, 211 "data": { 212 "failCommands": [ 213 "find" 214 ], 215 "errorCode": 13435 216 } 217 }, 218 "operations": [ 219 { 220 "name": "findOne", 221 "object": "collection", 222 "arguments": { 223 "filter": { 224 "_id": 1 225 } 226 }, 227 "result": { 228 "_id": 1, 229 "x": 11 230 } 231 } 232 ], 233 "expectations": [ 234 { 235 "command_started_event": { 236 "command": { 237 "find": "coll", 238 "filter": { 239 "_id": 1 240 } 241 }, 242 "database_name": "retryable-reads-tests" 243 } 244 }, 245 { 246 "command_started_event": { 247 "command": { 248 "find": "coll", 249 "filter": { 250 "_id": 1 251 } 252 }, 253 "database_name": "retryable-reads-tests" 254 } 255 } 256 ] 257 }, 258 { 259 "description": "FindOne succeeds after NotMasterOrSecondary", 260 "failPoint": { 261 "configureFailPoint": "failCommand", 262 "mode": { 263 "times": 1 264 }, 265 "data": { 266 "failCommands": [ 267 "find" 268 ], 269 "errorCode": 13436 270 } 271 }, 272 "operations": [ 273 { 274 "name": "findOne", 275 "object": "collection", 276 "arguments": { 277 "filter": { 278 "_id": 1 279 } 280 }, 281 "result": { 282 "_id": 1, 283 "x": 11 284 } 285 } 286 ], 287 "expectations": [ 288 { 289 "command_started_event": { 290 "command": { 291 "find": "coll", 292 "filter": { 293 "_id": 1 294 } 295 }, 296 "database_name": "retryable-reads-tests" 297 } 298 }, 299 { 300 "command_started_event": { 301 "command": { 302 "find": "coll", 303 "filter": { 304 "_id": 1 305 } 306 }, 307 "database_name": "retryable-reads-tests" 308 } 309 } 310 ] 311 }, 312 { 313 "description": "FindOne succeeds after PrimarySteppedDown", 314 "failPoint": { 315 "configureFailPoint": "failCommand", 316 "mode": { 317 "times": 1 318 }, 319 "data": { 320 "failCommands": [ 321 "find" 322 ], 323 "errorCode": 189 324 } 325 }, 326 "operations": [ 327 { 328 "name": "findOne", 329 "object": "collection", 330 "arguments": { 331 "filter": { 332 "_id": 1 333 } 334 }, 335 "result": { 336 "_id": 1, 337 "x": 11 338 } 339 } 340 ], 341 "expectations": [ 342 { 343 "command_started_event": { 344 "command": { 345 "find": "coll", 346 "filter": { 347 "_id": 1 348 } 349 }, 350 "database_name": "retryable-reads-tests" 351 } 352 }, 353 { 354 "command_started_event": { 355 "command": { 356 "find": "coll", 357 "filter": { 358 "_id": 1 359 } 360 }, 361 "database_name": "retryable-reads-tests" 362 } 363 } 364 ] 365 }, 366 { 367 "description": "FindOne succeeds after ShutdownInProgress", 368 "failPoint": { 369 "configureFailPoint": "failCommand", 370 "mode": { 371 "times": 1 372 }, 373 "data": { 374 "failCommands": [ 375 "find" 376 ], 377 "errorCode": 91 378 } 379 }, 380 "operations": [ 381 { 382 "name": "findOne", 383 "object": "collection", 384 "arguments": { 385 "filter": { 386 "_id": 1 387 } 388 }, 389 "result": { 390 "_id": 1, 391 "x": 11 392 } 393 } 394 ], 395 "expectations": [ 396 { 397 "command_started_event": { 398 "command": { 399 "find": "coll", 400 "filter": { 401 "_id": 1 402 } 403 }, 404 "database_name": "retryable-reads-tests" 405 } 406 }, 407 { 408 "command_started_event": { 409 "command": { 410 "find": "coll", 411 "filter": { 412 "_id": 1 413 } 414 }, 415 "database_name": "retryable-reads-tests" 416 } 417 } 418 ] 419 }, 420 { 421 "description": "FindOne succeeds after HostNotFound", 422 "failPoint": { 423 "configureFailPoint": "failCommand", 424 "mode": { 425 "times": 1 426 }, 427 "data": { 428 "failCommands": [ 429 "find" 430 ], 431 "errorCode": 7 432 } 433 }, 434 "operations": [ 435 { 436 "name": "findOne", 437 "object": "collection", 438 "arguments": { 439 "filter": { 440 "_id": 1 441 } 442 }, 443 "result": { 444 "_id": 1, 445 "x": 11 446 } 447 } 448 ], 449 "expectations": [ 450 { 451 "command_started_event": { 452 "command": { 453 "find": "coll", 454 "filter": { 455 "_id": 1 456 } 457 }, 458 "database_name": "retryable-reads-tests" 459 } 460 }, 461 { 462 "command_started_event": { 463 "command": { 464 "find": "coll", 465 "filter": { 466 "_id": 1 467 } 468 }, 469 "database_name": "retryable-reads-tests" 470 } 471 } 472 ] 473 }, 474 { 475 "description": "FindOne succeeds after HostUnreachable", 476 "failPoint": { 477 "configureFailPoint": "failCommand", 478 "mode": { 479 "times": 1 480 }, 481 "data": { 482 "failCommands": [ 483 "find" 484 ], 485 "errorCode": 6 486 } 487 }, 488 "operations": [ 489 { 490 "name": "findOne", 491 "object": "collection", 492 "arguments": { 493 "filter": { 494 "_id": 1 495 } 496 }, 497 "result": { 498 "_id": 1, 499 "x": 11 500 } 501 } 502 ], 503 "expectations": [ 504 { 505 "command_started_event": { 506 "command": { 507 "find": "coll", 508 "filter": { 509 "_id": 1 510 } 511 }, 512 "database_name": "retryable-reads-tests" 513 } 514 }, 515 { 516 "command_started_event": { 517 "command": { 518 "find": "coll", 519 "filter": { 520 "_id": 1 521 } 522 }, 523 "database_name": "retryable-reads-tests" 524 } 525 } 526 ] 527 }, 528 { 529 "description": "FindOne succeeds after NetworkTimeout", 530 "failPoint": { 531 "configureFailPoint": "failCommand", 532 "mode": { 533 "times": 1 534 }, 535 "data": { 536 "failCommands": [ 537 "find" 538 ], 539 "errorCode": 89 540 } 541 }, 542 "operations": [ 543 { 544 "name": "findOne", 545 "object": "collection", 546 "arguments": { 547 "filter": { 548 "_id": 1 549 } 550 }, 551 "result": { 552 "_id": 1, 553 "x": 11 554 } 555 } 556 ], 557 "expectations": [ 558 { 559 "command_started_event": { 560 "command": { 561 "find": "coll", 562 "filter": { 563 "_id": 1 564 } 565 }, 566 "database_name": "retryable-reads-tests" 567 } 568 }, 569 { 570 "command_started_event": { 571 "command": { 572 "find": "coll", 573 "filter": { 574 "_id": 1 575 } 576 }, 577 "database_name": "retryable-reads-tests" 578 } 579 } 580 ] 581 }, 582 { 583 "description": "FindOne succeeds after SocketException", 584 "failPoint": { 585 "configureFailPoint": "failCommand", 586 "mode": { 587 "times": 1 588 }, 589 "data": { 590 "failCommands": [ 591 "find" 592 ], 593 "errorCode": 9001 594 } 595 }, 596 "operations": [ 597 { 598 "name": "findOne", 599 "object": "collection", 600 "arguments": { 601 "filter": { 602 "_id": 1 603 } 604 }, 605 "result": { 606 "_id": 1, 607 "x": 11 608 } 609 } 610 ], 611 "expectations": [ 612 { 613 "command_started_event": { 614 "command": { 615 "find": "coll", 616 "filter": { 617 "_id": 1 618 } 619 }, 620 "database_name": "retryable-reads-tests" 621 } 622 }, 623 { 624 "command_started_event": { 625 "command": { 626 "find": "coll", 627 "filter": { 628 "_id": 1 629 } 630 }, 631 "database_name": "retryable-reads-tests" 632 } 633 } 634 ] 635 }, 636 { 637 "description": "FindOne fails after two NotMaster errors", 638 "failPoint": { 639 "configureFailPoint": "failCommand", 640 "mode": { 641 "times": 2 642 }, 643 "data": { 644 "failCommands": [ 645 "find" 646 ], 647 "errorCode": 10107 648 } 649 }, 650 "operations": [ 651 { 652 "name": "findOne", 653 "object": "collection", 654 "arguments": { 655 "filter": { 656 "_id": 1 657 } 658 }, 659 "error": true 660 } 661 ], 662 "expectations": [ 663 { 664 "command_started_event": { 665 "command": { 666 "find": "coll", 667 "filter": { 668 "_id": 1 669 } 670 }, 671 "database_name": "retryable-reads-tests" 672 } 673 }, 674 { 675 "command_started_event": { 676 "command": { 677 "find": "coll", 678 "filter": { 679 "_id": 1 680 } 681 }, 682 "database_name": "retryable-reads-tests" 683 } 684 } 685 ] 686 }, 687 { 688 "description": "FindOne fails after NotMaster when retryReads is false", 689 "clientOptions": { 690 "retryReads": false 691 }, 692 "failPoint": { 693 "configureFailPoint": "failCommand", 694 "mode": { 695 "times": 1 696 }, 697 "data": { 698 "failCommands": [ 699 "find" 700 ], 701 "errorCode": 10107 702 } 703 }, 704 "operations": [ 705 { 706 "name": "findOne", 707 "object": "collection", 708 "arguments": { 709 "filter": { 710 "_id": 1 711 } 712 }, 713 "error": true 714 } 715 ], 716 "expectations": [ 717 { 718 "command_started_event": { 719 "command": { 720 "find": "coll", 721 "filter": { 722 "_id": 1 723 } 724 }, 725 "database_name": "retryable-reads-tests" 726 } 727 } 728 ] 729 } 730 ] 731} 732