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 "tests": [
35 {
36 "description": "Aggregate succeeds after InterruptedAtShutdown",
37 "failPoint": {
38 "configureFailPoint": "failCommand",
39 "mode": {
40 "times": 1
41 },
42 "data": {
43 "failCommands": [
44 "aggregate"
45 ],
46 "errorCode": 11600
47 }
48 },
49 "operations": [
50 {
51 "name": "aggregate",
52 "object": "collection",
53 "arguments": {
54 "pipeline": [
55 {
56 "$match": {
57 "_id": {
58 "$gt": 1
59 }
60 }
61 },
62 {
63 "$sort": {
64 "x": 1
65 }
66 }
67 ]
68 },
69 "result": [
70 {
71 "_id": 2,
72 "x": 22
73 },
74 {
75 "_id": 3,
76 "x": 33
77 }
78 ]
79 }
80 ],
81 "expectations": [
82 {
83 "command_started_event": {
84 "command": {
85 "aggregate": "coll",
86 "pipeline": [
87 {
88 "$match": {
89 "_id": {
90 "$gt": 1
91 }
92 }
93 },
94 {
95 "$sort": {
96 "x": 1
97 }
98 }
99 ]
100 },
101 "database_name": "retryable-reads-tests"
102 }
103 },
104 {
105 "command_started_event": {
106 "command": {
107 "aggregate": "coll",
108 "pipeline": [
109 {
110 "$match": {
111 "_id": {
112 "$gt": 1
113 }
114 }
115 },
116 {
117 "$sort": {
118 "x": 1
119 }
120 }
121 ]
122 },
123 "database_name": "retryable-reads-tests"
124 }
125 }
126 ]
127 },
128 {
129 "description": "Aggregate succeeds after InterruptedDueToReplStateChange",
130 "failPoint": {
131 "configureFailPoint": "failCommand",
132 "mode": {
133 "times": 1
134 },
135 "data": {
136 "failCommands": [
137 "aggregate"
138 ],
139 "errorCode": 11602
140 }
141 },
142 "operations": [
143 {
144 "name": "aggregate",
145 "object": "collection",
146 "arguments": {
147 "pipeline": [
148 {
149 "$match": {
150 "_id": {
151 "$gt": 1
152 }
153 }
154 },
155 {
156 "$sort": {
157 "x": 1
158 }
159 }
160 ]
161 },
162 "result": [
163 {
164 "_id": 2,
165 "x": 22
166 },
167 {
168 "_id": 3,
169 "x": 33
170 }
171 ]
172 }
173 ],
174 "expectations": [
175 {
176 "command_started_event": {
177 "command": {
178 "aggregate": "coll",
179 "pipeline": [
180 {
181 "$match": {
182 "_id": {
183 "$gt": 1
184 }
185 }
186 },
187 {
188 "$sort": {
189 "x": 1
190 }
191 }
192 ]
193 },
194 "database_name": "retryable-reads-tests"
195 }
196 },
197 {
198 "command_started_event": {
199 "command": {
200 "aggregate": "coll",
201 "pipeline": [
202 {
203 "$match": {
204 "_id": {
205 "$gt": 1
206 }
207 }
208 },
209 {
210 "$sort": {
211 "x": 1
212 }
213 }
214 ]
215 },
216 "database_name": "retryable-reads-tests"
217 }
218 }
219 ]
220 },
221 {
222 "description": "Aggregate succeeds after NotWritablePrimary",
223 "failPoint": {
224 "configureFailPoint": "failCommand",
225 "mode": {
226 "times": 1
227 },
228 "data": {
229 "failCommands": [
230 "aggregate"
231 ],
232 "errorCode": 10107
233 }
234 },
235 "operations": [
236 {
237 "name": "aggregate",
238 "object": "collection",
239 "arguments": {
240 "pipeline": [
241 {
242 "$match": {
243 "_id": {
244 "$gt": 1
245 }
246 }
247 },
248 {
249 "$sort": {
250 "x": 1
251 }
252 }
253 ]
254 },
255 "result": [
256 {
257 "_id": 2,
258 "x": 22
259 },
260 {
261 "_id": 3,
262 "x": 33
263 }
264 ]
265 }
266 ],
267 "expectations": [
268 {
269 "command_started_event": {
270 "command": {
271 "aggregate": "coll",
272 "pipeline": [
273 {
274 "$match": {
275 "_id": {
276 "$gt": 1
277 }
278 }
279 },
280 {
281 "$sort": {
282 "x": 1
283 }
284 }
285 ]
286 },
287 "database_name": "retryable-reads-tests"
288 }
289 },
290 {
291 "command_started_event": {
292 "command": {
293 "aggregate": "coll",
294 "pipeline": [
295 {
296 "$match": {
297 "_id": {
298 "$gt": 1
299 }
300 }
301 },
302 {
303 "$sort": {
304 "x": 1
305 }
306 }
307 ]
308 },
309 "database_name": "retryable-reads-tests"
310 }
311 }
312 ]
313 },
314 {
315 "description": "Aggregate succeeds after NotPrimaryNoSecondaryOk",
316 "failPoint": {
317 "configureFailPoint": "failCommand",
318 "mode": {
319 "times": 1
320 },
321 "data": {
322 "failCommands": [
323 "aggregate"
324 ],
325 "errorCode": 13435
326 }
327 },
328 "operations": [
329 {
330 "name": "aggregate",
331 "object": "collection",
332 "arguments": {
333 "pipeline": [
334 {
335 "$match": {
336 "_id": {
337 "$gt": 1
338 }
339 }
340 },
341 {
342 "$sort": {
343 "x": 1
344 }
345 }
346 ]
347 },
348 "result": [
349 {
350 "_id": 2,
351 "x": 22
352 },
353 {
354 "_id": 3,
355 "x": 33
356 }
357 ]
358 }
359 ],
360 "expectations": [
361 {
362 "command_started_event": {
363 "command": {
364 "aggregate": "coll",
365 "pipeline": [
366 {
367 "$match": {
368 "_id": {
369 "$gt": 1
370 }
371 }
372 },
373 {
374 "$sort": {
375 "x": 1
376 }
377 }
378 ]
379 },
380 "database_name": "retryable-reads-tests"
381 }
382 },
383 {
384 "command_started_event": {
385 "command": {
386 "aggregate": "coll",
387 "pipeline": [
388 {
389 "$match": {
390 "_id": {
391 "$gt": 1
392 }
393 }
394 },
395 {
396 "$sort": {
397 "x": 1
398 }
399 }
400 ]
401 },
402 "database_name": "retryable-reads-tests"
403 }
404 }
405 ]
406 },
407 {
408 "description": "Aggregate succeeds after NotPrimaryOrSecondary",
409 "failPoint": {
410 "configureFailPoint": "failCommand",
411 "mode": {
412 "times": 1
413 },
414 "data": {
415 "failCommands": [
416 "aggregate"
417 ],
418 "errorCode": 13436
419 }
420 },
421 "operations": [
422 {
423 "name": "aggregate",
424 "object": "collection",
425 "arguments": {
426 "pipeline": [
427 {
428 "$match": {
429 "_id": {
430 "$gt": 1
431 }
432 }
433 },
434 {
435 "$sort": {
436 "x": 1
437 }
438 }
439 ]
440 },
441 "result": [
442 {
443 "_id": 2,
444 "x": 22
445 },
446 {
447 "_id": 3,
448 "x": 33
449 }
450 ]
451 }
452 ],
453 "expectations": [
454 {
455 "command_started_event": {
456 "command": {
457 "aggregate": "coll",
458 "pipeline": [
459 {
460 "$match": {
461 "_id": {
462 "$gt": 1
463 }
464 }
465 },
466 {
467 "$sort": {
468 "x": 1
469 }
470 }
471 ]
472 },
473 "database_name": "retryable-reads-tests"
474 }
475 },
476 {
477 "command_started_event": {
478 "command": {
479 "aggregate": "coll",
480 "pipeline": [
481 {
482 "$match": {
483 "_id": {
484 "$gt": 1
485 }
486 }
487 },
488 {
489 "$sort": {
490 "x": 1
491 }
492 }
493 ]
494 },
495 "database_name": "retryable-reads-tests"
496 }
497 }
498 ]
499 },
500 {
501 "description": "Aggregate succeeds after PrimarySteppedDown",
502 "failPoint": {
503 "configureFailPoint": "failCommand",
504 "mode": {
505 "times": 1
506 },
507 "data": {
508 "failCommands": [
509 "aggregate"
510 ],
511 "errorCode": 189
512 }
513 },
514 "operations": [
515 {
516 "name": "aggregate",
517 "object": "collection",
518 "arguments": {
519 "pipeline": [
520 {
521 "$match": {
522 "_id": {
523 "$gt": 1
524 }
525 }
526 },
527 {
528 "$sort": {
529 "x": 1
530 }
531 }
532 ]
533 },
534 "result": [
535 {
536 "_id": 2,
537 "x": 22
538 },
539 {
540 "_id": 3,
541 "x": 33
542 }
543 ]
544 }
545 ],
546 "expectations": [
547 {
548 "command_started_event": {
549 "command": {
550 "aggregate": "coll",
551 "pipeline": [
552 {
553 "$match": {
554 "_id": {
555 "$gt": 1
556 }
557 }
558 },
559 {
560 "$sort": {
561 "x": 1
562 }
563 }
564 ]
565 },
566 "database_name": "retryable-reads-tests"
567 }
568 },
569 {
570 "command_started_event": {
571 "command": {
572 "aggregate": "coll",
573 "pipeline": [
574 {
575 "$match": {
576 "_id": {
577 "$gt": 1
578 }
579 }
580 },
581 {
582 "$sort": {
583 "x": 1
584 }
585 }
586 ]
587 },
588 "database_name": "retryable-reads-tests"
589 }
590 }
591 ]
592 },
593 {
594 "description": "Aggregate succeeds after ShutdownInProgress",
595 "failPoint": {
596 "configureFailPoint": "failCommand",
597 "mode": {
598 "times": 1
599 },
600 "data": {
601 "failCommands": [
602 "aggregate"
603 ],
604 "errorCode": 91
605 }
606 },
607 "operations": [
608 {
609 "name": "aggregate",
610 "object": "collection",
611 "arguments": {
612 "pipeline": [
613 {
614 "$match": {
615 "_id": {
616 "$gt": 1
617 }
618 }
619 },
620 {
621 "$sort": {
622 "x": 1
623 }
624 }
625 ]
626 },
627 "result": [
628 {
629 "_id": 2,
630 "x": 22
631 },
632 {
633 "_id": 3,
634 "x": 33
635 }
636 ]
637 }
638 ],
639 "expectations": [
640 {
641 "command_started_event": {
642 "command": {
643 "aggregate": "coll",
644 "pipeline": [
645 {
646 "$match": {
647 "_id": {
648 "$gt": 1
649 }
650 }
651 },
652 {
653 "$sort": {
654 "x": 1
655 }
656 }
657 ]
658 },
659 "database_name": "retryable-reads-tests"
660 }
661 },
662 {
663 "command_started_event": {
664 "command": {
665 "aggregate": "coll",
666 "pipeline": [
667 {
668 "$match": {
669 "_id": {
670 "$gt": 1
671 }
672 }
673 },
674 {
675 "$sort": {
676 "x": 1
677 }
678 }
679 ]
680 },
681 "database_name": "retryable-reads-tests"
682 }
683 }
684 ]
685 },
686 {
687 "description": "Aggregate succeeds after HostNotFound",
688 "failPoint": {
689 "configureFailPoint": "failCommand",
690 "mode": {
691 "times": 1
692 },
693 "data": {
694 "failCommands": [
695 "aggregate"
696 ],
697 "errorCode": 7
698 }
699 },
700 "operations": [
701 {
702 "name": "aggregate",
703 "object": "collection",
704 "arguments": {
705 "pipeline": [
706 {
707 "$match": {
708 "_id": {
709 "$gt": 1
710 }
711 }
712 },
713 {
714 "$sort": {
715 "x": 1
716 }
717 }
718 ]
719 },
720 "result": [
721 {
722 "_id": 2,
723 "x": 22
724 },
725 {
726 "_id": 3,
727 "x": 33
728 }
729 ]
730 }
731 ],
732 "expectations": [
733 {
734 "command_started_event": {
735 "command": {
736 "aggregate": "coll",
737 "pipeline": [
738 {
739 "$match": {
740 "_id": {
741 "$gt": 1
742 }
743 }
744 },
745 {
746 "$sort": {
747 "x": 1
748 }
749 }
750 ]
751 },
752 "database_name": "retryable-reads-tests"
753 }
754 },
755 {
756 "command_started_event": {
757 "command": {
758 "aggregate": "coll",
759 "pipeline": [
760 {
761 "$match": {
762 "_id": {
763 "$gt": 1
764 }
765 }
766 },
767 {
768 "$sort": {
769 "x": 1
770 }
771 }
772 ]
773 },
774 "database_name": "retryable-reads-tests"
775 }
776 }
777 ]
778 },
779 {
780 "description": "Aggregate succeeds after HostUnreachable",
781 "failPoint": {
782 "configureFailPoint": "failCommand",
783 "mode": {
784 "times": 1
785 },
786 "data": {
787 "failCommands": [
788 "aggregate"
789 ],
790 "errorCode": 6
791 }
792 },
793 "operations": [
794 {
795 "name": "aggregate",
796 "object": "collection",
797 "arguments": {
798 "pipeline": [
799 {
800 "$match": {
801 "_id": {
802 "$gt": 1
803 }
804 }
805 },
806 {
807 "$sort": {
808 "x": 1
809 }
810 }
811 ]
812 },
813 "result": [
814 {
815 "_id": 2,
816 "x": 22
817 },
818 {
819 "_id": 3,
820 "x": 33
821 }
822 ]
823 }
824 ],
825 "expectations": [
826 {
827 "command_started_event": {
828 "command": {
829 "aggregate": "coll",
830 "pipeline": [
831 {
832 "$match": {
833 "_id": {
834 "$gt": 1
835 }
836 }
837 },
838 {
839 "$sort": {
840 "x": 1
841 }
842 }
843 ]
844 },
845 "database_name": "retryable-reads-tests"
846 }
847 },
848 {
849 "command_started_event": {
850 "command": {
851 "aggregate": "coll",
852 "pipeline": [
853 {
854 "$match": {
855 "_id": {
856 "$gt": 1
857 }
858 }
859 },
860 {
861 "$sort": {
862 "x": 1
863 }
864 }
865 ]
866 },
867 "database_name": "retryable-reads-tests"
868 }
869 }
870 ]
871 },
872 {
873 "description": "Aggregate succeeds after NetworkTimeout",
874 "failPoint": {
875 "configureFailPoint": "failCommand",
876 "mode": {
877 "times": 1
878 },
879 "data": {
880 "failCommands": [
881 "aggregate"
882 ],
883 "errorCode": 89
884 }
885 },
886 "operations": [
887 {
888 "name": "aggregate",
889 "object": "collection",
890 "arguments": {
891 "pipeline": [
892 {
893 "$match": {
894 "_id": {
895 "$gt": 1
896 }
897 }
898 },
899 {
900 "$sort": {
901 "x": 1
902 }
903 }
904 ]
905 },
906 "result": [
907 {
908 "_id": 2,
909 "x": 22
910 },
911 {
912 "_id": 3,
913 "x": 33
914 }
915 ]
916 }
917 ],
918 "expectations": [
919 {
920 "command_started_event": {
921 "command": {
922 "aggregate": "coll",
923 "pipeline": [
924 {
925 "$match": {
926 "_id": {
927 "$gt": 1
928 }
929 }
930 },
931 {
932 "$sort": {
933 "x": 1
934 }
935 }
936 ]
937 },
938 "database_name": "retryable-reads-tests"
939 }
940 },
941 {
942 "command_started_event": {
943 "command": {
944 "aggregate": "coll",
945 "pipeline": [
946 {
947 "$match": {
948 "_id": {
949 "$gt": 1
950 }
951 }
952 },
953 {
954 "$sort": {
955 "x": 1
956 }
957 }
958 ]
959 },
960 "database_name": "retryable-reads-tests"
961 }
962 }
963 ]
964 },
965 {
966 "description": "Aggregate succeeds after SocketException",
967 "failPoint": {
968 "configureFailPoint": "failCommand",
969 "mode": {
970 "times": 1
971 },
972 "data": {
973 "failCommands": [
974 "aggregate"
975 ],
976 "errorCode": 9001
977 }
978 },
979 "operations": [
980 {
981 "name": "aggregate",
982 "object": "collection",
983 "arguments": {
984 "pipeline": [
985 {
986 "$match": {
987 "_id": {
988 "$gt": 1
989 }
990 }
991 },
992 {
993 "$sort": {
994 "x": 1
995 }
996 }
997 ]
998 },
999 "result": [
1000 {
1001 "_id": 2,
1002 "x": 22
1003 },
1004 {
1005 "_id": 3,
1006 "x": 33
1007 }
1008 ]
1009 }
1010 ],
1011 "expectations": [
1012 {
1013 "command_started_event": {
1014 "command": {
1015 "aggregate": "coll",
1016 "pipeline": [
1017 {
1018 "$match": {
1019 "_id": {
1020 "$gt": 1
1021 }
1022 }
1023 },
1024 {
1025 "$sort": {
1026 "x": 1
1027 }
1028 }
1029 ]
1030 },
1031 "database_name": "retryable-reads-tests"
1032 }
1033 },
1034 {
1035 "command_started_event": {
1036 "command": {
1037 "aggregate": "coll",
1038 "pipeline": [
1039 {
1040 "$match": {
1041 "_id": {
1042 "$gt": 1
1043 }
1044 }
1045 },
1046 {
1047 "$sort": {
1048 "x": 1
1049 }
1050 }
1051 ]
1052 },
1053 "database_name": "retryable-reads-tests"
1054 }
1055 }
1056 ]
1057 },
1058 {
1059 "description": "Aggregate fails after two NotWritablePrimary errors",
1060 "failPoint": {
1061 "configureFailPoint": "failCommand",
1062 "mode": {
1063 "times": 2
1064 },
1065 "data": {
1066 "failCommands": [
1067 "aggregate"
1068 ],
1069 "errorCode": 10107
1070 }
1071 },
1072 "operations": [
1073 {
1074 "name": "aggregate",
1075 "object": "collection",
1076 "arguments": {
1077 "pipeline": [
1078 {
1079 "$match": {
1080 "_id": {
1081 "$gt": 1
1082 }
1083 }
1084 },
1085 {
1086 "$sort": {
1087 "x": 1
1088 }
1089 }
1090 ]
1091 },
1092 "error": true
1093 }
1094 ],
1095 "expectations": [
1096 {
1097 "command_started_event": {
1098 "command": {
1099 "aggregate": "coll",
1100 "pipeline": [
1101 {
1102 "$match": {
1103 "_id": {
1104 "$gt": 1
1105 }
1106 }
1107 },
1108 {
1109 "$sort": {
1110 "x": 1
1111 }
1112 }
1113 ]
1114 },
1115 "database_name": "retryable-reads-tests"
1116 }
1117 },
1118 {
1119 "command_started_event": {
1120 "command": {
1121 "aggregate": "coll",
1122 "pipeline": [
1123 {
1124 "$match": {
1125 "_id": {
1126 "$gt": 1
1127 }
1128 }
1129 },
1130 {
1131 "$sort": {
1132 "x": 1
1133 }
1134 }
1135 ]
1136 },
1137 "database_name": "retryable-reads-tests"
1138 }
1139 }
1140 ]
1141 },
1142 {
1143 "description": "Aggregate fails after NotWritablePrimary when retryReads is false",
1144 "clientOptions": {
1145 "retryReads": false
1146 },
1147 "failPoint": {
1148 "configureFailPoint": "failCommand",
1149 "mode": {
1150 "times": 1
1151 },
1152 "data": {
1153 "failCommands": [
1154 "aggregate"
1155 ],
1156 "errorCode": 10107
1157 }
1158 },
1159 "operations": [
1160 {
1161 "name": "aggregate",
1162 "object": "collection",
1163 "arguments": {
1164 "pipeline": [
1165 {
1166 "$match": {
1167 "_id": {
1168 "$gt": 1
1169 }
1170 }
1171 },
1172 {
1173 "$sort": {
1174 "x": 1
1175 }
1176 }
1177 ]
1178 },
1179 "error": true
1180 }
1181 ],
1182 "expectations": [
1183 {
1184 "command_started_event": {
1185 "command": {
1186 "aggregate": "coll",
1187 "pipeline": [
1188 {
1189 "$match": {
1190 "_id": {
1191 "$gt": 1
1192 }
1193 }
1194 },
1195 {
1196 "$sort": {
1197 "x": 1
1198 }
1199 }
1200 ]
1201 },
1202 "database_name": "retryable-reads-tests"
1203 }
1204 }
1205 ]
1206 }
1207 ]
1208}
View as plain text