|
18 | 18 | "data": [],
|
19 | 19 | "tests": [
|
20 | 20 | {
|
21 |
| - "description": "commitTransaction succeeds after multiple connection errors", |
| 21 | + "description": "callback succeeds after multiple connection errors", |
22 | 22 | "failPoint": {
|
23 | 23 | "configureFailPoint": "failCommand",
|
24 | 24 | "mode": {
|
25 | 25 | "times": 2
|
26 | 26 | },
|
27 | 27 | "data": {
|
28 | 28 | "failCommands": [
|
29 |
| - "commitTransaction" |
| 29 | + "insert" |
30 | 30 | ],
|
31 | 31 | "closeConnection": true
|
32 | 32 | }
|
|
46 | 46 | "document": {
|
47 | 47 | "_id": 1
|
48 | 48 | }
|
49 |
| - }, |
50 |
| - "result": { |
51 |
| - "insertedId": 1 |
52 | 49 | }
|
53 | 50 | }
|
54 | 51 | ]
|
|
83 | 80 | {
|
84 | 81 | "command_started_event": {
|
85 | 82 | "command": {
|
86 |
| - "commitTransaction": 1, |
| 83 | + "abortTransaction": 1, |
87 | 84 | "lsid": "session0",
|
88 | 85 | "txnNumber": {
|
89 | 86 | "$numberLong": "1"
|
|
93 | 90 | "startTransaction": null,
|
94 | 91 | "writeConcern": null
|
95 | 92 | },
|
96 |
| - "command_name": "commitTransaction", |
| 93 | + "command_name": "abortTransaction", |
97 | 94 | "database_name": "admin"
|
98 | 95 | }
|
99 | 96 | },
|
100 |
| - { |
101 |
| - "command_started_event": { |
102 |
| - "command": { |
103 |
| - "commitTransaction": 1, |
104 |
| - "lsid": "session0", |
105 |
| - "txnNumber": { |
106 |
| - "$numberLong": "1" |
107 |
| - }, |
108 |
| - "autocommit": false, |
109 |
| - "writeConcern": { |
110 |
| - "w": "majority", |
111 |
| - "wtimeout": 10000 |
112 |
| - }, |
113 |
| - "readConcern": null, |
114 |
| - "startTransaction": null |
115 |
| - }, |
116 |
| - "command_name": "commitTransaction", |
117 |
| - "database_name": "admin" |
118 |
| - } |
119 |
| - }, |
120 |
| - { |
121 |
| - "command_started_event": { |
122 |
| - "command": { |
123 |
| - "commitTransaction": 1, |
124 |
| - "lsid": "session0", |
125 |
| - "txnNumber": { |
126 |
| - "$numberLong": "1" |
127 |
| - }, |
128 |
| - "autocommit": false, |
129 |
| - "writeConcern": { |
130 |
| - "w": "majority", |
131 |
| - "wtimeout": 10000 |
132 |
| - }, |
133 |
| - "readConcern": null, |
134 |
| - "startTransaction": null |
135 |
| - }, |
136 |
| - "command_name": "commitTransaction", |
137 |
| - "database_name": "admin" |
138 |
| - } |
139 |
| - } |
140 |
| - ], |
141 |
| - "outcome": { |
142 |
| - "collection": { |
143 |
| - "data": [ |
144 |
| - { |
145 |
| - "_id": 1 |
146 |
| - } |
147 |
| - ] |
148 |
| - } |
149 |
| - } |
150 |
| - }, |
151 |
| - { |
152 |
| - "description": "commitTransaction retry only overwrites write concern w option", |
153 |
| - "failPoint": { |
154 |
| - "configureFailPoint": "failCommand", |
155 |
| - "mode": { |
156 |
| - "times": 2 |
157 |
| - }, |
158 |
| - "data": { |
159 |
| - "failCommands": [ |
160 |
| - "commitTransaction" |
161 |
| - ], |
162 |
| - "closeConnection": true |
163 |
| - } |
164 |
| - }, |
165 |
| - "operations": [ |
166 |
| - { |
167 |
| - "name": "withTransaction", |
168 |
| - "object": "session0", |
169 |
| - "arguments": { |
170 |
| - "callback": { |
171 |
| - "operations": [ |
172 |
| - { |
173 |
| - "name": "insertOne", |
174 |
| - "object": "collection", |
175 |
| - "arguments": { |
176 |
| - "session": "session0", |
177 |
| - "document": { |
178 |
| - "_id": 1 |
179 |
| - } |
180 |
| - }, |
181 |
| - "result": { |
182 |
| - "insertedId": 1 |
183 |
| - } |
184 |
| - } |
185 |
| - ] |
186 |
| - }, |
187 |
| - "options": { |
188 |
| - "writeConcern": { |
189 |
| - "w": 2, |
190 |
| - "j": true, |
191 |
| - "wtimeout": 5000 |
192 |
| - } |
193 |
| - } |
194 |
| - } |
195 |
| - } |
196 |
| - ], |
197 |
| - "expectations": [ |
198 | 97 | {
|
199 | 98 | "command_started_event": {
|
200 | 99 | "command": {
|
|
206 | 105 | ],
|
207 | 106 | "ordered": true,
|
208 | 107 | "lsid": "session0",
|
| 108 | + "readConcern": { |
| 109 | + "afterClusterTime": 42 |
| 110 | + }, |
209 | 111 | "txnNumber": {
|
210 |
| - "$numberLong": "1" |
| 112 | + "$numberLong": "2" |
211 | 113 | },
|
212 | 114 | "startTransaction": true,
|
213 | 115 | "autocommit": false,
|
214 |
| - "readConcern": null, |
215 | 116 | "writeConcern": null
|
216 | 117 | },
|
217 | 118 | "command_name": "insert",
|
|
221 | 122 | {
|
222 | 123 | "command_started_event": {
|
223 | 124 | "command": {
|
224 |
| - "commitTransaction": 1, |
| 125 | + "abortTransaction": 1, |
225 | 126 | "lsid": "session0",
|
226 | 127 | "txnNumber": {
|
227 |
| - "$numberLong": "1" |
| 128 | + "$numberLong": "2" |
228 | 129 | },
|
229 | 130 | "autocommit": false,
|
230 |
| - "writeConcern": { |
231 |
| - "w": 2, |
232 |
| - "j": true, |
233 |
| - "wtimeout": 5000 |
234 |
| - }, |
235 | 131 | "readConcern": null,
|
236 |
| - "startTransaction": null |
| 132 | + "startTransaction": null, |
| 133 | + "writeConcern": null |
237 | 134 | },
|
238 |
| - "command_name": "commitTransaction", |
| 135 | + "command_name": "abortTransaction", |
239 | 136 | "database_name": "admin"
|
240 | 137 | }
|
241 | 138 | },
|
242 | 139 | {
|
243 | 140 | "command_started_event": {
|
244 | 141 | "command": {
|
245 |
| - "commitTransaction": 1, |
| 142 | + "insert": "test", |
| 143 | + "documents": [ |
| 144 | + { |
| 145 | + "_id": 1 |
| 146 | + } |
| 147 | + ], |
| 148 | + "ordered": true, |
246 | 149 | "lsid": "session0",
|
| 150 | + "readConcern": { |
| 151 | + "afterClusterTime": 42 |
| 152 | + }, |
247 | 153 | "txnNumber": {
|
248 |
| - "$numberLong": "1" |
| 154 | + "$numberLong": "3" |
249 | 155 | },
|
| 156 | + "startTransaction": true, |
250 | 157 | "autocommit": false,
|
251 |
| - "writeConcern": { |
252 |
| - "w": "majority", |
253 |
| - "j": true, |
254 |
| - "wtimeout": 5000 |
255 |
| - }, |
256 |
| - "readConcern": null, |
257 |
| - "startTransaction": null |
| 158 | + "writeConcern": null |
258 | 159 | },
|
259 |
| - "command_name": "commitTransaction", |
260 |
| - "database_name": "admin" |
| 160 | + "command_name": "insert", |
| 161 | + "database_name": "withTransaction-tests" |
261 | 162 | }
|
262 | 163 | },
|
263 | 164 | {
|
|
266 | 167 | "commitTransaction": 1,
|
267 | 168 | "lsid": "session0",
|
268 | 169 | "txnNumber": {
|
269 |
| - "$numberLong": "1" |
| 170 | + "$numberLong": "3" |
270 | 171 | },
|
271 | 172 | "autocommit": false,
|
272 |
| - "writeConcern": { |
273 |
| - "w": "majority", |
274 |
| - "j": true, |
275 |
| - "wtimeout": 5000 |
276 |
| - }, |
277 | 173 | "readConcern": null,
|
278 |
| - "startTransaction": null |
| 174 | + "startTransaction": null, |
| 175 | + "writeConcern": null |
279 | 176 | },
|
280 | 177 | "command_name": "commitTransaction",
|
281 | 178 | "database_name": "admin"
|
|
293 | 190 | }
|
294 | 191 | },
|
295 | 192 | {
|
296 |
| - "description": "commit is retried after commitTransaction UnknownTransactionCommitResult (NotMaster)", |
297 |
| - "failPoint": { |
298 |
| - "configureFailPoint": "failCommand", |
299 |
| - "mode": { |
300 |
| - "times": 2 |
301 |
| - }, |
302 |
| - "data": { |
303 |
| - "failCommands": [ |
304 |
| - "commitTransaction" |
305 |
| - ], |
306 |
| - "errorCode": 10107, |
307 |
| - "closeConnection": false |
308 |
| - } |
309 |
| - }, |
| 193 | + "description": "callback is not retried after non-transient error (DuplicateKeyError)", |
| 194 | + "useMultipleMongoses": true, |
310 | 195 | "operations": [
|
311 | 196 | {
|
312 | 197 | "name": "withTransaction",
|
|
326 | 211 | "result": {
|
327 | 212 | "insertedId": 1
|
328 | 213 | }
|
| 214 | + }, |
| 215 | + { |
| 216 | + "name": "insertOne", |
| 217 | + "object": "collection", |
| 218 | + "arguments": { |
| 219 | + "session": "session0", |
| 220 | + "document": { |
| 221 | + "_id": 1 |
| 222 | + } |
| 223 | + }, |
| 224 | + "result": { |
| 225 | + "errorLabelsOmit": [ |
| 226 | + "TransientTransactionError", |
| 227 | + "UnknownTransactionCommitResult" |
| 228 | + ] |
| 229 | + } |
329 | 230 | }
|
330 | 231 | ]
|
331 | 232 | }
|
| 233 | + }, |
| 234 | + "result": { |
| 235 | + "errorLabelsOmit": [ |
| 236 | + "TransientTransactionError", |
| 237 | + "UnknownTransactionCommitResult" |
| 238 | + ] |
332 | 239 | }
|
333 | 240 | }
|
334 | 241 | ],
|
|
359 | 266 | {
|
360 | 267 | "command_started_event": {
|
361 | 268 | "command": {
|
362 |
| - "commitTransaction": 1, |
| 269 | + "insert": "test", |
| 270 | + "documents": [ |
| 271 | + { |
| 272 | + "_id": 1 |
| 273 | + } |
| 274 | + ], |
| 275 | + "ordered": true, |
363 | 276 | "lsid": "session0",
|
364 | 277 | "txnNumber": {
|
365 | 278 | "$numberLong": "1"
|
|
369 | 282 | "startTransaction": null,
|
370 | 283 | "writeConcern": null
|
371 | 284 | },
|
372 |
| - "command_name": "commitTransaction", |
373 |
| - "database_name": "admin" |
374 |
| - } |
375 |
| - }, |
376 |
| - { |
377 |
| - "command_started_event": { |
378 |
| - "command": { |
379 |
| - "commitTransaction": 1, |
380 |
| - "lsid": "session0", |
381 |
| - "txnNumber": { |
382 |
| - "$numberLong": "1" |
383 |
| - }, |
384 |
| - "autocommit": false, |
385 |
| - "writeConcern": { |
386 |
| - "w": "majority", |
387 |
| - "wtimeout": 10000 |
388 |
| - }, |
389 |
| - "readConcern": null, |
390 |
| - "startTransaction": null |
391 |
| - }, |
392 |
| - "command_name": "commitTransaction", |
393 |
| - "database_name": "admin" |
| 285 | + "command_name": "insert", |
| 286 | + "database_name": "withTransaction-tests" |
394 | 287 | }
|
395 | 288 | },
|
396 | 289 | {
|
397 | 290 | "command_started_event": {
|
398 | 291 | "command": {
|
399 |
| - "commitTransaction": 1, |
| 292 | + "abortTransaction": 1, |
400 | 293 | "lsid": "session0",
|
401 | 294 | "txnNumber": {
|
402 | 295 | "$numberLong": "1"
|
403 | 296 | },
|
404 | 297 | "autocommit": false,
|
405 |
| - "writeConcern": { |
406 |
| - "w": "majority", |
407 |
| - "wtimeout": 10000 |
408 |
| - }, |
409 | 298 | "readConcern": null,
|
410 |
| - "startTransaction": null |
| 299 | + "startTransaction": null, |
| 300 | + "writeConcern": null |
411 | 301 | },
|
412 |
| - "command_name": "commitTransaction", |
| 302 | + "command_name": "abortTransaction", |
413 | 303 | "database_name": "admin"
|
414 | 304 | }
|
415 | 305 | }
|
416 | 306 | ],
|
417 | 307 | "outcome": {
|
418 | 308 | "collection": {
|
419 |
| - "data": [ |
420 |
| - { |
421 |
| - "_id": 1 |
422 |
| - } |
423 |
| - ] |
| 309 | + "data": [] |
424 | 310 | }
|
425 | 311 | }
|
426 | 312 | }
|
|
0 commit comments