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 "load-balanced"
15 ]
16 }
17 ],
18 "database_name": "retryable-reads-tests",
19 "collection_name": "coll",
20 "data": [
21 {
22 "_id": 1,
23 "x": 11
24 },
25 {
26 "_id": 2,
27 "x": 22
28 },
29 {
30 "_id": 3,
31 "x": 33
32 },
33 {
34 "_id": 4,
35 "x": 44
36 },
37 {
38 "_id": 5,
39 "x": 55
40 }
41 ],
42 "tests": [
43 {
44 "description": "Find succeeds after InterruptedAtShutdown",
45 "failPoint": {
46 "configureFailPoint": "failCommand",
47 "mode": {
48 "times": 1
49 },
50 "data": {
51 "failCommands": [
52 "find"
53 ],
54 "errorCode": 11600
55 }
56 },
57 "operations": [
58 {
59 "name": "find",
60 "object": "collection",
61 "arguments": {
62 "filter": {},
63 "sort": {
64 "_id": 1
65 },
66 "limit": 4
67 },
68 "result": [
69 {
70 "_id": 1,
71 "x": 11
72 },
73 {
74 "_id": 2,
75 "x": 22
76 },
77 {
78 "_id": 3,
79 "x": 33
80 },
81 {
82 "_id": 4,
83 "x": 44
84 }
85 ]
86 }
87 ],
88 "expectations": [
89 {
90 "command_started_event": {
91 "command": {
92 "find": "coll",
93 "filter": {},
94 "sort": {
95 "_id": 1
96 },
97 "limit": 4
98 },
99 "database_name": "retryable-reads-tests"
100 }
101 },
102 {
103 "command_started_event": {
104 "command": {
105 "find": "coll",
106 "filter": {},
107 "sort": {
108 "_id": 1
109 },
110 "limit": 4
111 },
112 "database_name": "retryable-reads-tests"
113 }
114 }
115 ]
116 },
117 {
118 "description": "Find succeeds after InterruptedDueToReplStateChange",
119 "failPoint": {
120 "configureFailPoint": "failCommand",
121 "mode": {
122 "times": 1
123 },
124 "data": {
125 "failCommands": [
126 "find"
127 ],
128 "errorCode": 11602
129 }
130 },
131 "operations": [
132 {
133 "name": "find",
134 "object": "collection",
135 "arguments": {
136 "filter": {},
137 "sort": {
138 "_id": 1
139 },
140 "limit": 4
141 },
142 "result": [
143 {
144 "_id": 1,
145 "x": 11
146 },
147 {
148 "_id": 2,
149 "x": 22
150 },
151 {
152 "_id": 3,
153 "x": 33
154 },
155 {
156 "_id": 4,
157 "x": 44
158 }
159 ]
160 }
161 ],
162 "expectations": [
163 {
164 "command_started_event": {
165 "command": {
166 "find": "coll",
167 "filter": {},
168 "sort": {
169 "_id": 1
170 },
171 "limit": 4
172 },
173 "database_name": "retryable-reads-tests"
174 }
175 },
176 {
177 "command_started_event": {
178 "command": {
179 "find": "coll",
180 "filter": {},
181 "sort": {
182 "_id": 1
183 },
184 "limit": 4
185 },
186 "database_name": "retryable-reads-tests"
187 }
188 }
189 ]
190 },
191 {
192 "description": "Find succeeds after NotWritablePrimary",
193 "failPoint": {
194 "configureFailPoint": "failCommand",
195 "mode": {
196 "times": 1
197 },
198 "data": {
199 "failCommands": [
200 "find"
201 ],
202 "errorCode": 10107
203 }
204 },
205 "operations": [
206 {
207 "name": "find",
208 "object": "collection",
209 "arguments": {
210 "filter": {},
211 "sort": {
212 "_id": 1
213 },
214 "limit": 4
215 },
216 "result": [
217 {
218 "_id": 1,
219 "x": 11
220 },
221 {
222 "_id": 2,
223 "x": 22
224 },
225 {
226 "_id": 3,
227 "x": 33
228 },
229 {
230 "_id": 4,
231 "x": 44
232 }
233 ]
234 }
235 ],
236 "expectations": [
237 {
238 "command_started_event": {
239 "command": {
240 "find": "coll",
241 "filter": {},
242 "sort": {
243 "_id": 1
244 },
245 "limit": 4
246 },
247 "database_name": "retryable-reads-tests"
248 }
249 },
250 {
251 "command_started_event": {
252 "command": {
253 "find": "coll",
254 "filter": {},
255 "sort": {
256 "_id": 1
257 },
258 "limit": 4
259 },
260 "database_name": "retryable-reads-tests"
261 }
262 }
263 ]
264 },
265 {
266 "description": "Find succeeds after NotPrimaryNoSecondaryOk",
267 "failPoint": {
268 "configureFailPoint": "failCommand",
269 "mode": {
270 "times": 1
271 },
272 "data": {
273 "failCommands": [
274 "find"
275 ],
276 "errorCode": 13435
277 }
278 },
279 "operations": [
280 {
281 "name": "find",
282 "object": "collection",
283 "arguments": {
284 "filter": {},
285 "sort": {
286 "_id": 1
287 },
288 "limit": 4
289 },
290 "result": [
291 {
292 "_id": 1,
293 "x": 11
294 },
295 {
296 "_id": 2,
297 "x": 22
298 },
299 {
300 "_id": 3,
301 "x": 33
302 },
303 {
304 "_id": 4,
305 "x": 44
306 }
307 ]
308 }
309 ],
310 "expectations": [
311 {
312 "command_started_event": {
313 "command": {
314 "find": "coll",
315 "filter": {},
316 "sort": {
317 "_id": 1
318 },
319 "limit": 4
320 },
321 "database_name": "retryable-reads-tests"
322 }
323 },
324 {
325 "command_started_event": {
326 "command": {
327 "find": "coll",
328 "filter": {},
329 "sort": {
330 "_id": 1
331 },
332 "limit": 4
333 },
334 "database_name": "retryable-reads-tests"
335 }
336 }
337 ]
338 },
339 {
340 "description": "Find succeeds after NotPrimaryOrSecondary",
341 "failPoint": {
342 "configureFailPoint": "failCommand",
343 "mode": {
344 "times": 1
345 },
346 "data": {
347 "failCommands": [
348 "find"
349 ],
350 "errorCode": 13436
351 }
352 },
353 "operations": [
354 {
355 "name": "find",
356 "object": "collection",
357 "arguments": {
358 "filter": {},
359 "sort": {
360 "_id": 1
361 },
362 "limit": 4
363 },
364 "result": [
365 {
366 "_id": 1,
367 "x": 11
368 },
369 {
370 "_id": 2,
371 "x": 22
372 },
373 {
374 "_id": 3,
375 "x": 33
376 },
377 {
378 "_id": 4,
379 "x": 44
380 }
381 ]
382 }
383 ],
384 "expectations": [
385 {
386 "command_started_event": {
387 "command": {
388 "find": "coll",
389 "filter": {},
390 "sort": {
391 "_id": 1
392 },
393 "limit": 4
394 },
395 "database_name": "retryable-reads-tests"
396 }
397 },
398 {
399 "command_started_event": {
400 "command": {
401 "find": "coll",
402 "filter": {},
403 "sort": {
404 "_id": 1
405 },
406 "limit": 4
407 },
408 "database_name": "retryable-reads-tests"
409 }
410 }
411 ]
412 },
413 {
414 "description": "Find succeeds after PrimarySteppedDown",
415 "failPoint": {
416 "configureFailPoint": "failCommand",
417 "mode": {
418 "times": 1
419 },
420 "data": {
421 "failCommands": [
422 "find"
423 ],
424 "errorCode": 189
425 }
426 },
427 "operations": [
428 {
429 "name": "find",
430 "object": "collection",
431 "arguments": {
432 "filter": {},
433 "sort": {
434 "_id": 1
435 },
436 "limit": 4
437 },
438 "result": [
439 {
440 "_id": 1,
441 "x": 11
442 },
443 {
444 "_id": 2,
445 "x": 22
446 },
447 {
448 "_id": 3,
449 "x": 33
450 },
451 {
452 "_id": 4,
453 "x": 44
454 }
455 ]
456 }
457 ],
458 "expectations": [
459 {
460 "command_started_event": {
461 "command": {
462 "find": "coll",
463 "filter": {},
464 "sort": {
465 "_id": 1
466 },
467 "limit": 4
468 },
469 "database_name": "retryable-reads-tests"
470 }
471 },
472 {
473 "command_started_event": {
474 "command": {
475 "find": "coll",
476 "filter": {},
477 "sort": {
478 "_id": 1
479 },
480 "limit": 4
481 },
482 "database_name": "retryable-reads-tests"
483 }
484 }
485 ]
486 },
487 {
488 "description": "Find succeeds after ShutdownInProgress",
489 "failPoint": {
490 "configureFailPoint": "failCommand",
491 "mode": {
492 "times": 1
493 },
494 "data": {
495 "failCommands": [
496 "find"
497 ],
498 "errorCode": 91
499 }
500 },
501 "operations": [
502 {
503 "name": "find",
504 "object": "collection",
505 "arguments": {
506 "filter": {},
507 "sort": {
508 "_id": 1
509 },
510 "limit": 4
511 },
512 "result": [
513 {
514 "_id": 1,
515 "x": 11
516 },
517 {
518 "_id": 2,
519 "x": 22
520 },
521 {
522 "_id": 3,
523 "x": 33
524 },
525 {
526 "_id": 4,
527 "x": 44
528 }
529 ]
530 }
531 ],
532 "expectations": [
533 {
534 "command_started_event": {
535 "command": {
536 "find": "coll",
537 "filter": {},
538 "sort": {
539 "_id": 1
540 },
541 "limit": 4
542 },
543 "database_name": "retryable-reads-tests"
544 }
545 },
546 {
547 "command_started_event": {
548 "command": {
549 "find": "coll",
550 "filter": {},
551 "sort": {
552 "_id": 1
553 },
554 "limit": 4
555 },
556 "database_name": "retryable-reads-tests"
557 }
558 }
559 ]
560 },
561 {
562 "description": "Find succeeds after HostNotFound",
563 "failPoint": {
564 "configureFailPoint": "failCommand",
565 "mode": {
566 "times": 1
567 },
568 "data": {
569 "failCommands": [
570 "find"
571 ],
572 "errorCode": 7
573 }
574 },
575 "operations": [
576 {
577 "name": "find",
578 "object": "collection",
579 "arguments": {
580 "filter": {},
581 "sort": {
582 "_id": 1
583 },
584 "limit": 4
585 },
586 "result": [
587 {
588 "_id": 1,
589 "x": 11
590 },
591 {
592 "_id": 2,
593 "x": 22
594 },
595 {
596 "_id": 3,
597 "x": 33
598 },
599 {
600 "_id": 4,
601 "x": 44
602 }
603 ]
604 }
605 ],
606 "expectations": [
607 {
608 "command_started_event": {
609 "command": {
610 "find": "coll",
611 "filter": {},
612 "sort": {
613 "_id": 1
614 },
615 "limit": 4
616 },
617 "database_name": "retryable-reads-tests"
618 }
619 },
620 {
621 "command_started_event": {
622 "command": {
623 "find": "coll",
624 "filter": {},
625 "sort": {
626 "_id": 1
627 },
628 "limit": 4
629 },
630 "database_name": "retryable-reads-tests"
631 }
632 }
633 ]
634 },
635 {
636 "description": "Find succeeds after HostUnreachable",
637 "failPoint": {
638 "configureFailPoint": "failCommand",
639 "mode": {
640 "times": 1
641 },
642 "data": {
643 "failCommands": [
644 "find"
645 ],
646 "errorCode": 6
647 }
648 },
649 "operations": [
650 {
651 "name": "find",
652 "object": "collection",
653 "arguments": {
654 "filter": {},
655 "sort": {
656 "_id": 1
657 },
658 "limit": 4
659 },
660 "result": [
661 {
662 "_id": 1,
663 "x": 11
664 },
665 {
666 "_id": 2,
667 "x": 22
668 },
669 {
670 "_id": 3,
671 "x": 33
672 },
673 {
674 "_id": 4,
675 "x": 44
676 }
677 ]
678 }
679 ],
680 "expectations": [
681 {
682 "command_started_event": {
683 "command": {
684 "find": "coll",
685 "filter": {},
686 "sort": {
687 "_id": 1
688 },
689 "limit": 4
690 },
691 "database_name": "retryable-reads-tests"
692 }
693 },
694 {
695 "command_started_event": {
696 "command": {
697 "find": "coll",
698 "filter": {},
699 "sort": {
700 "_id": 1
701 },
702 "limit": 4
703 },
704 "database_name": "retryable-reads-tests"
705 }
706 }
707 ]
708 },
709 {
710 "description": "Find succeeds after NetworkTimeout",
711 "failPoint": {
712 "configureFailPoint": "failCommand",
713 "mode": {
714 "times": 1
715 },
716 "data": {
717 "failCommands": [
718 "find"
719 ],
720 "errorCode": 89
721 }
722 },
723 "operations": [
724 {
725 "name": "find",
726 "object": "collection",
727 "arguments": {
728 "filter": {},
729 "sort": {
730 "_id": 1
731 },
732 "limit": 4
733 },
734 "result": [
735 {
736 "_id": 1,
737 "x": 11
738 },
739 {
740 "_id": 2,
741 "x": 22
742 },
743 {
744 "_id": 3,
745 "x": 33
746 },
747 {
748 "_id": 4,
749 "x": 44
750 }
751 ]
752 }
753 ],
754 "expectations": [
755 {
756 "command_started_event": {
757 "command": {
758 "find": "coll",
759 "filter": {},
760 "sort": {
761 "_id": 1
762 },
763 "limit": 4
764 },
765 "database_name": "retryable-reads-tests"
766 }
767 },
768 {
769 "command_started_event": {
770 "command": {
771 "find": "coll",
772 "filter": {},
773 "sort": {
774 "_id": 1
775 },
776 "limit": 4
777 },
778 "database_name": "retryable-reads-tests"
779 }
780 }
781 ]
782 },
783 {
784 "description": "Find succeeds after SocketException",
785 "failPoint": {
786 "configureFailPoint": "failCommand",
787 "mode": {
788 "times": 1
789 },
790 "data": {
791 "failCommands": [
792 "find"
793 ],
794 "errorCode": 9001
795 }
796 },
797 "operations": [
798 {
799 "name": "find",
800 "object": "collection",
801 "arguments": {
802 "filter": {},
803 "sort": {
804 "_id": 1
805 },
806 "limit": 4
807 },
808 "result": [
809 {
810 "_id": 1,
811 "x": 11
812 },
813 {
814 "_id": 2,
815 "x": 22
816 },
817 {
818 "_id": 3,
819 "x": 33
820 },
821 {
822 "_id": 4,
823 "x": 44
824 }
825 ]
826 }
827 ],
828 "expectations": [
829 {
830 "command_started_event": {
831 "command": {
832 "find": "coll",
833 "filter": {},
834 "sort": {
835 "_id": 1
836 },
837 "limit": 4
838 },
839 "database_name": "retryable-reads-tests"
840 }
841 },
842 {
843 "command_started_event": {
844 "command": {
845 "find": "coll",
846 "filter": {},
847 "sort": {
848 "_id": 1
849 },
850 "limit": 4
851 },
852 "database_name": "retryable-reads-tests"
853 }
854 }
855 ]
856 },
857 {
858 "description": "Find fails after two NotWritablePrimary errors",
859 "failPoint": {
860 "configureFailPoint": "failCommand",
861 "mode": {
862 "times": 2
863 },
864 "data": {
865 "failCommands": [
866 "find"
867 ],
868 "errorCode": 10107
869 }
870 },
871 "operations": [
872 {
873 "name": "find",
874 "object": "collection",
875 "arguments": {
876 "filter": {},
877 "sort": {
878 "_id": 1
879 },
880 "limit": 4
881 },
882 "error": true
883 }
884 ],
885 "expectations": [
886 {
887 "command_started_event": {
888 "command": {
889 "find": "coll",
890 "filter": {},
891 "sort": {
892 "_id": 1
893 },
894 "limit": 4
895 },
896 "database_name": "retryable-reads-tests"
897 }
898 },
899 {
900 "command_started_event": {
901 "command": {
902 "find": "coll",
903 "filter": {},
904 "sort": {
905 "_id": 1
906 },
907 "limit": 4
908 },
909 "database_name": "retryable-reads-tests"
910 }
911 }
912 ]
913 },
914 {
915 "description": "Find fails after NotWritablePrimary when retryReads is false",
916 "clientOptions": {
917 "retryReads": false
918 },
919 "failPoint": {
920 "configureFailPoint": "failCommand",
921 "mode": {
922 "times": 1
923 },
924 "data": {
925 "failCommands": [
926 "find"
927 ],
928 "errorCode": 10107
929 }
930 },
931 "operations": [
932 {
933 "name": "find",
934 "object": "collection",
935 "arguments": {
936 "filter": {},
937 "sort": {
938 "_id": 1
939 },
940 "limit": 4
941 },
942 "error": true
943 }
944 ],
945 "expectations": [
946 {
947 "command_started_event": {
948 "command": {
949 "find": "coll",
950 "filter": {},
951 "sort": {
952 "_id": 1
953 },
954 "limit": 4
955 },
956 "database_name": "retryable-reads-tests"
957 }
958 }
959 ]
960 }
961 ]
962}
View as plain text