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