Debian Codegraph @

testdata/transactions/legacy/retryable-writes.json

raw symbols SCIP
1 {
2 "runOn": [
3 {
4 "minServerVersion": "4.0",
5 "topology": [
6 "replicaset"
7 ]
8 },
9 {
10 "minServerVersion": "4.1.8",
11 "topology": [
12 "sharded"
13 ]
14 }
15 ],
16 "database_name": "transaction-tests",
17 "collection_name": "test",
18 "data": [],
19 "tests": [
20 {
21 "description": "increment txnNumber",
22 "clientOptions": {
23 "retryWrites": true
24 },
25 "operations": [
26 {
27 "name": "startTransaction",
28 "object": "session0"
29 },
30 {
31 "name": "insertOne",
32 "object": "collection",
33 "arguments": {
34 "session": "session0",
35 "document": {
36 "_id": 1
37 }
38 },
39 "result": {
40 "insertedId": 1
41 }
42 },
43 {
44 "name": "commitTransaction",
45 "object": "session0"
46 },
47 {
48 "name": "insertOne",
49 "object": "collection",
50 "arguments": {
51 "session": "session0",
52 "document": {
53 "_id": 2
54 }
55 },
56 "result": {
57 "insertedId": 2
58 }
59 },
60 {
61 "name": "startTransaction",
62 "object": "session0"
63 },
64 {
65 "name": "insertOne",
66 "object": "collection",
67 "arguments": {
68 "session": "session0",
69 "document": {
70 "_id": 3
71 }
72 },
73 "result": {
74 "insertedId": 3
75 }
76 },
77 {
78 "name": "abortTransaction",
79 "object": "session0"
80 },
81 {
82 "name": "insertMany",
83 "object": "collection",
84 "arguments": {
85 "documents": [
86 {
87 "_id": 4
88 },
89 {
90 "_id": 5
91 }
92 ],
93 "session": "session0"
94 },
95 "result": {
96 "insertedIds": {
97 "0": 4,
98 "1": 5
99 }
100 }
101 }
102 ],
103 "expectations": [
104 {
105 "command_started_event": {
106 "command": {
107 "insert": "test",
108 "documents": [
109 {
110 "_id": 1
111 }
112 ],
113 "ordered": true,
114 "readConcern": null,
115 "lsid": "session0",
116 "txnNumber": {
117 "$numberLong": "1"
118 },
119 "startTransaction": true,
120 "autocommit": false,
121 "writeConcern": null
122 },
123 "command_name": "insert",
124 "database_name": "transaction-tests"
125 }
126 },
127 {
128 "command_started_event": {
129 "command": {
130 "commitTransaction": 1,
131 "lsid": "session0",
132 "txnNumber": {
133 "$numberLong": "1"
134 },
135 "startTransaction": null,
136 "autocommit": false,
137 "writeConcern": null
138 },
139 "command_name": "commitTransaction",
140 "database_name": "admin"
141 }
142 },
143 {
144 "command_started_event": {
145 "command": {
146 "insert": "test",
147 "documents": [
148 {
149 "_id": 2
150 }
151 ],
152 "ordered": true,
153 "readConcern": null,
154 "lsid": "session0",
155 "txnNumber": {
156 "$numberLong": "2"
157 },
158 "startTransaction": null,
159 "autocommit": null,
160 "writeConcern": null
161 },
162 "command_name": "insert",
163 "database_name": "transaction-tests"
164 }
165 },
166 {
167 "command_started_event": {
168 "command": {
169 "insert": "test",
170 "documents": [
171 {
172 "_id": 3
173 }
174 ],
175 "ordered": true,
176 "readConcern": {
177 "afterClusterTime": 42
178 },
179 "lsid": "session0",
180 "txnNumber": {
181 "$numberLong": "3"
182 },
183 "startTransaction": true,
184 "autocommit": false,
185 "writeConcern": null
186 },
187 "command_name": "insert",
188 "database_name": "transaction-tests"
189 }
190 },
191 {
192 "command_started_event": {
193 "command": {
194 "abortTransaction": 1,
195 "lsid": "session0",
196 "txnNumber": {
197 "$numberLong": "3"
198 },
199 "startTransaction": null,
200 "autocommit": false,
201 "writeConcern": null
202 },
203 "command_name": "abortTransaction",
204 "database_name": "admin"
205 }
206 },
207 {
208 "command_started_event": {
209 "command": {
210 "insert": "test",
211 "documents": [
212 {
213 "_id": 4
214 },
215 {
216 "_id": 5
217 }
218 ],
219 "ordered": true,
220 "readConcern": null,
221 "lsid": "session0",
222 "txnNumber": {
223 "$numberLong": "4"
224 },
225 "startTransaction": null,
226 "autocommit": null,
227 "writeConcern": null
228 },
229 "command_name": "insert",
230 "database_name": "transaction-tests"
231 }
232 }
233 ],
234 "outcome": {
235 "collection": {
236 "data": [
237 {
238 "_id": 1
239 },
240 {
241 "_id": 2
242 },
243 {
244 "_id": 4
245 },
246 {
247 "_id": 5
248 }
249 ]
250 }
251 }
252 },
253 {
254 "description": "writes are not retried",
255 "clientOptions": {
256 "retryWrites": true
257 },
258 "failPoint": {
259 "configureFailPoint": "failCommand",
260 "mode": {
261 "times": 1
262 },
263 "data": {
264 "failCommands": [
265 "insert"
266 ],
267 "closeConnection": true
268 }
269 },
270 "operations": [
271 {
272 "name": "startTransaction",
273 "object": "session0"
274 },
275 {
276 "name": "insertOne",
277 "object": "collection",
278 "arguments": {
279 "session": "session0",
280 "document": {
281 "_id": 1
282 }
283 },
284 "result": {
285 "errorLabelsContain": [
286 "TransientTransactionError"
287 ]
288 }
289 },
290 {
291 "name": "abortTransaction",
292 "object": "session0"
293 }
294 ],
295 "expectations": [
296 {
297 "command_started_event": {
298 "command": {
299 "insert": "test",
300 "documents": [
301 {
302 "_id": 1
303 }
304 ],
305 "ordered": true,
306 "readConcern": null,
307 "lsid": "session0",
308 "txnNumber": {
309 "$numberLong": "1"
310 },
311 "startTransaction": true,
312 "autocommit": false,
313 "writeConcern": null
314 },
315 "command_name": "insert",
316 "database_name": "transaction-tests"
317 }
318 },
319 {
320 "command_started_event": {
321 "command": {
322 "abortTransaction": 1,
323 "lsid": "session0",
324 "txnNumber": {
325 "$numberLong": "1"
326 },
327 "startTransaction": null,
328 "autocommit": false,
329 "writeConcern": null
330 },
331 "command_name": "abortTransaction",
332 "database_name": "admin"
333 }
334 }
335 ],
336 "outcome": {
337 "collection": {
338 "data": []
339 }
340 }
341 }
342 ]
343 }