...
1runOn:
2 -
3 minServerVersion: "4.0"
4 topology: ["single", "replicaset"]
5 -
6 minServerVersion: "4.1.7"
7 topology: ["sharded", "load-balanced"]
8
9database_name: &database_name "retryable-reads-tests"
10collection_name: &collection_name "coll"
11
12data:
13 - { _id: 1, x: 11 }
14 - { _id: 2, x: 22 }
15
16tests:
17 -
18 description: "Count succeeds after InterruptedAtShutdown"
19 failPoint: &failCommand_failPoint
20 configureFailPoint: failCommand
21 mode: { times: 1 }
22 data: { failCommands: [count], errorCode: 11600 }
23 operations:
24 - &retryable_operation_succeeds
25 <<: &retryable_operation
26 name: count
27 object: collection
28 arguments: { filter: { } }
29 result: 2
30 expectations:
31 - &retryable_command_started_event
32 command_started_event:
33 command:
34 count: *collection_name
35 database_name: *database_name
36 - *retryable_command_started_event
37 -
38 description: "Count succeeds after InterruptedDueToReplStateChange"
39 failPoint:
40 <<: *failCommand_failPoint
41 data: { failCommands: [count], errorCode: 11602 }
42 operations: [*retryable_operation_succeeds]
43 expectations:
44 - *retryable_command_started_event
45 - *retryable_command_started_event
46 -
47 description: "Count succeeds after NotWritablePrimary"
48 failPoint:
49 <<: *failCommand_failPoint
50 data: { failCommands: [count], errorCode: 10107 }
51 operations: [*retryable_operation_succeeds]
52 expectations:
53 - *retryable_command_started_event
54 - *retryable_command_started_event
55 -
56 description: "Count succeeds after NotPrimaryNoSecondaryOk"
57 failPoint:
58 <<: *failCommand_failPoint
59 data: { failCommands: [count], errorCode: 13435 }
60 operations: [*retryable_operation_succeeds]
61 expectations:
62 - *retryable_command_started_event
63 - *retryable_command_started_event
64 -
65 description: "Count succeeds after NotPrimaryOrSecondary"
66 failPoint:
67 <<: *failCommand_failPoint
68 data: { failCommands: [count], errorCode: 13436 }
69 operations: [*retryable_operation_succeeds]
70 expectations:
71 - *retryable_command_started_event
72 - *retryable_command_started_event
73 -
74 description: "Count succeeds after PrimarySteppedDown"
75 failPoint:
76 <<: *failCommand_failPoint
77 data: { failCommands: [count], errorCode: 189 }
78 operations: [*retryable_operation_succeeds]
79 expectations:
80 - *retryable_command_started_event
81 - *retryable_command_started_event
82 -
83 description: "Count succeeds after ShutdownInProgress"
84 failPoint:
85 <<: *failCommand_failPoint
86 data: { failCommands: [count], errorCode: 91 }
87 operations: [*retryable_operation_succeeds]
88 expectations:
89 - *retryable_command_started_event
90 - *retryable_command_started_event
91 -
92 description: "Count succeeds after HostNotFound"
93 failPoint:
94 <<: *failCommand_failPoint
95 data: { failCommands: [count], errorCode: 7 }
96 operations: [*retryable_operation_succeeds]
97 expectations:
98 - *retryable_command_started_event
99 - *retryable_command_started_event
100 -
101 description: "Count succeeds after HostUnreachable"
102 failPoint:
103 <<: *failCommand_failPoint
104 data: { failCommands: [count], errorCode: 6 }
105 operations: [*retryable_operation_succeeds]
106 expectations:
107 - *retryable_command_started_event
108 - *retryable_command_started_event
109 -
110 description: "Count succeeds after NetworkTimeout"
111 failPoint:
112 <<: *failCommand_failPoint
113 data: { failCommands: [count], errorCode: 89 }
114 operations: [*retryable_operation_succeeds]
115 expectations:
116 - *retryable_command_started_event
117 - *retryable_command_started_event
118 -
119 description: "Count succeeds after SocketException"
120 failPoint:
121 <<: *failCommand_failPoint
122 data: { failCommands: [count], errorCode: 9001 }
123 operations: [*retryable_operation_succeeds]
124 expectations:
125 - *retryable_command_started_event
126 - *retryable_command_started_event
127 -
128 description: "Count fails after two NotWritablePrimary errors"
129 failPoint:
130 <<: *failCommand_failPoint
131 mode: { times: 2 }
132 data: { failCommands: [count], errorCode: 10107 }
133 operations:
134 - &retryable_operation_fails
135 <<: *retryable_operation
136 error: true
137 expectations:
138 - *retryable_command_started_event
139 - *retryable_command_started_event
140 -
141 description: "Count fails after NotWritablePrimary when retryReads is false"
142 clientOptions:
143 retryReads: false
144 failPoint:
145 <<: *failCommand_failPoint
146 data: { failCommands: [count], errorCode: 10107 }
147 operations: [*retryable_operation_fails]
148 expectations:
149 - *retryable_command_started_event
150
View as plain text