Debian Codegraph @

testdata/transactions/legacy/error-labels.yml

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