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": "BulkWrite succeeds after PrimarySteppedDown",
30 "failPoint": {
31 "configureFailPoint": "failCommand",
32 "mode": {
33 "times": 1
34 },
35 "data": {
36 "failCommands": [
37 "update"
38 ],
39 "errorCode": 189,
40 "errorLabels": [
41 "RetryableWriteError"
42 ]
43 }
44 },
45 "operation": {
46 "name": "bulkWrite",
47 "arguments": {
48 "requests": [
49 {
50 "name": "deleteOne",
51 "arguments": {
52 "filter": {
53 "_id": 1
54 }
55 }
56 },
57 {
58 "name": "insertOne",
59 "arguments": {
60 "document": {
61 "_id": 3,
62 "x": 33
63 }
64 }
65 },
66 {
67 "name": "updateOne",
68 "arguments": {
69 "filter": {
70 "_id": 2
71 },
72 "update": {
73 "$inc": {
74 "x": 1
75 }
76 }
77 }
78 }
79 ],
80 "options": {
81 "ordered": true
82 }
83 }
84 },
85 "outcome": {
86 "result": {
87 "deletedCount": 1,
88 "insertedCount": 1,
89 "insertedIds": {
90 "1": 3
91 },
92 "matchedCount": 1,
93 "modifiedCount": 1,
94 "upsertedCount": 0,
95 "upsertedIds": {}
96 },
97 "collection": {
98 "data": [
99 {
100 "_id": 2,
101 "x": 23
102 },
103 {
104 "_id": 3,
105 "x": 33
106 }
107 ]
108 }
109 }
110 },
111 {
112 "description": "BulkWrite succeeds after WriteConcernError ShutdownInProgress",
113 "failPoint": {
114 "configureFailPoint": "failCommand",
115 "mode": {
116 "times": 1
117 },
118 "data": {
119 "failCommands": [
120 "insert"
121 ],
122 "writeConcernError": {
123 "code": 91,
124 "errmsg": "Replication is being shut down",
125 "errorLabels": [
126 "RetryableWriteError"
127 ]
128 }
129 }
130 },
131 "operation": {
132 "name": "bulkWrite",
133 "arguments": {
134 "requests": [
135 {
136 "name": "deleteOne",
137 "arguments": {
138 "filter": {
139 "_id": 1
140 }
141 }
142 },
143 {
144 "name": "insertOne",
145 "arguments": {
146 "document": {
147 "_id": 3,
148 "x": 33
149 }
150 }
151 },
152 {
153 "name": "updateOne",
154 "arguments": {
155 "filter": {
156 "_id": 2
157 },
158 "update": {
159 "$inc": {
160 "x": 1
161 }
162 }
163 }
164 }
165 ],
166 "options": {
167 "ordered": true
168 }
169 }
170 },
171 "outcome": {
172 "result": {
173 "deletedCount": 1,
174 "insertedCount": 1,
175 "insertedIds": {
176 "1": 3
177 },
178 "matchedCount": 1,
179 "modifiedCount": 1,
180 "upsertedCount": 0,
181 "upsertedIds": {}
182 },
183 "collection": {
184 "data": [
185 {
186 "_id": 2,
187 "x": 23
188 },
189 {
190 "_id": 3,
191 "x": 33
192 }
193 ]
194 }
195 }
196 },
197 {
198 "description": "BulkWrite fails with a RetryableWriteError label after two connection failures",
199 "failPoint": {
200 "configureFailPoint": "failCommand",
201 "mode": {
202 "times": 2
203 },
204 "data": {
205 "failCommands": [
206 "update"
207 ],
208 "closeConnection": true
209 }
210 },
211 "operation": {
212 "name": "bulkWrite",
213 "arguments": {
214 "requests": [
215 {
216 "name": "deleteOne",
217 "arguments": {
218 "filter": {
219 "_id": 1
220 }
221 }
222 },
223 {
224 "name": "insertOne",
225 "arguments": {
226 "document": {
227 "_id": 3,
228 "x": 33
229 }
230 }
231 },
232 {
233 "name": "updateOne",
234 "arguments": {
235 "filter": {
236 "_id": 2
237 },
238 "update": {
239 "$inc": {
240 "x": 1
241 }
242 }
243 }
244 }
245 ],
246 "options": {
247 "ordered": true
248 }
249 }
250 },
251 "outcome": {
252 "error": true,
253 "result": {
254 "errorLabelsContain": [
255 "RetryableWriteError"
256 ]
257 },
258 "collection": {
259 "data": [
260 {
261 "_id": 2,
262 "x": 22
263 },
264 {
265 "_id": 3,
266 "x": 33
267 }
268 ]
269 }
270 }
271 }
272 ]
273}
View as plain text