Debian Codegraph @

testdata/transactions/legacy/read-concern.yml

raw symbols SCIP
1 runOn:
2 -
3 minServerVersion: "4.0"
4 topology: ["replicaset"]
5 -
6 minServerVersion: "4.1.8"
7 topology: ["sharded"]
8
9 database_name: &database_name "transaction-tests"
10 collection_name: &collection_name "test"
11
12 data: &data
13 - {_id: 1}
14 - {_id: 2}
15 - {_id: 3}
16 - {_id: 4}
17
18 tests:
19 - description: only first countDocuments includes readConcern
20
21 operations:
22 - &startTransaction
23 name: startTransaction
24 object: session0
25 arguments:
26 options:
27 readConcern:
28 level: majority
29 - &countDocuments
30 name: countDocuments
31 object: collection
32 collectionOptions:
33 readConcern:
34 level: majority
35 arguments:
36 session: session0
37 filter: {_id: {$gte: 2}}
38 result: 3
39 - *countDocuments
40 - &commitTransaction
41 name: commitTransaction
42 object: session0
43
44 expectations:
45 - command_started_event:
46 command:
47 aggregate: *collection_name
48 pipeline:
49 - $match: {_id: {$gte: 2}}
50 - $group: {_id: 1, n: {$sum: 1}}
51 cursor: {}
52 lsid: session0
53 readConcern:
54 level: majority
55 txnNumber:
56 $numberLong: "1"
57 startTransaction: true
58 autocommit: false
59 command_name: aggregate
60 database_name: *database_name
61 - command_started_event:
62 command:
63 aggregate: *collection_name
64 pipeline:
65 - $match: {_id: {$gte: 2}}
66 - $group: {_id: 1, n: {$sum: 1}}
67 cursor: {}
68 lsid: session0
69 readConcern: # No readConcern
70 txnNumber:
71 $numberLong: "1"
72 startTransaction:
73 autocommit: false
74 command_name: aggregate
75 database_name: *database_name
76 - &commitTransactionEvent
77 command_started_event:
78 command:
79 commitTransaction: 1
80 lsid: session0
81 readConcern:
82 txnNumber:
83 $numberLong: "1"
84 startTransaction:
85 autocommit: false
86 writeConcern:
87 command_name: commitTransaction
88 database_name: admin
89
90 outcome: &outcome
91 collection:
92 data:
93 *data
94
95 - description: only first find includes readConcern
96
97 operations:
98 - *startTransaction
99 - &find
100 name: find
101 object: collection
102 collectionOptions:
103 readConcern:
104 level: majority
105 arguments:
106 session: session0
107 batchSize: 3
108 result: *data
109 - *find
110 - *commitTransaction
111
112 expectations:
113 - command_started_event:
114 command:
115 find: *collection_name
116 batchSize: 3
117 lsid: session0
118 readConcern:
119 level: majority
120 txnNumber:
121 $numberLong: "1"
122 startTransaction: true
123 autocommit: false
124 command_name: find
125 database_name: *database_name
126 - command_started_event:
127 command:
128 getMore:
129 # 42 is a fake placeholder value for the cursorId.
130 $numberLong: '42'
131 collection: *collection_name
132 batchSize: 3
133 lsid: session0
134 readConcern: # No readConcern
135 txnNumber:
136 $numberLong: "1"
137 startTransaction:
138 autocommit: false
139 command_name: getMore
140 database_name: *database_name
141 - command_started_event:
142 command:
143 find: *collection_name
144 batchSize: 3
145 lsid: session0
146 readConcern: # No readConcern
147 txnNumber:
148 $numberLong: "1"
149 startTransaction:
150 autocommit: false
151 command_name: find
152 database_name: *database_name
153 - command_started_event:
154 command:
155 getMore:
156 $numberLong: '42'
157 collection: *collection_name
158 batchSize: 3
159 lsid: session0
160 readConcern: # No readConcern
161 txnNumber:
162 $numberLong: "1"
163 startTransaction:
164 autocommit: false
165 command_name: getMore
166 database_name: *database_name
167 - *commitTransactionEvent
168
169 outcome: &outcome
170 collection:
171 data:
172 *data
173
174 - description: only first aggregate includes readConcern
175
176 operations:
177 - *startTransaction
178 - &aggregate
179 name: aggregate
180 object: collection
181 collectionOptions:
182 readConcern:
183 level: majority
184 arguments:
185 pipeline:
186 - $project:
187 _id: 1
188 batchSize: 3
189 session: session0
190 result: *data
191 - *aggregate
192 - *commitTransaction
193
194 expectations:
195 - command_started_event:
196 command:
197 aggregate: *collection_name
198 pipeline:
199 - $project:
200 _id: 1
201 cursor:
202 batchSize: 3
203 lsid: session0
204 readConcern:
205 level: majority
206 txnNumber:
207 $numberLong: "1"
208 startTransaction: true
209 autocommit: false
210 command_name: aggregate
211 database_name: *database_name
212 - command_started_event:
213 command:
214 getMore:
215 # 42 is a fake placeholder value for the cursorId.
216 $numberLong: '42'
217 collection: *collection_name
218 batchSize: 3
219 lsid: session0
220 readConcern: # No readConcern
221 txnNumber:
222 $numberLong: "1"
223 startTransaction:
224 autocommit: false
225 command_name: getMore
226 database_name: *database_name
227 - command_started_event:
228 command:
229 aggregate: *collection_name
230 pipeline:
231 - $project:
232 _id: 1
233 cursor:
234 batchSize: 3
235 lsid: session0
236 readConcern: # No readConcern
237 txnNumber:
238 $numberLong: "1"
239 startTransaction:
240 autocommit: false
241 command_name: aggregate
242 database_name: *database_name
243 - command_started_event:
244 command:
245 getMore:
246 $numberLong: '42'
247 collection: *collection_name
248 batchSize: 3
249 lsid: session0
250 readConcern: # No readConcern
251 txnNumber:
252 $numberLong: "1"
253 startTransaction:
254 autocommit: false
255 command_name: getMore
256 database_name: *database_name
257 - *commitTransactionEvent
258
259 outcome: *outcome
260
261 - description: only first distinct includes readConcern
262
263 operations:
264 - *startTransaction
265 - &distinct
266 name: distinct
267 object: collection
268 collectionOptions:
269 readConcern:
270 level: majority
271 arguments:
272 session: session0
273 fieldName: _id
274 result: [1, 2, 3, 4]
275 - *distinct
276 - *commitTransaction
277
278 expectations:
279 - command_started_event:
280 command:
281 distinct: *collection_name
282 key: _id
283 lsid: session0
284 readConcern:
285 level: majority
286 txnNumber:
287 $numberLong: "1"
288 startTransaction: true
289 autocommit: false
290 writeConcern:
291 command_name: distinct
292 database_name: *database_name
293 - command_started_event:
294 command:
295 distinct: *collection_name
296 key: _id
297 lsid: session0
298 readConcern: # No readConcern
299 txnNumber:
300 $numberLong: "1"
301 startTransaction:
302 autocommit: false
303 writeConcern:
304 command_name: distinct
305 database_name: *database_name
306 - *commitTransactionEvent
307
308 outcome: *outcome
309
310 - description: only first runCommand includes readConcern
311
312 operations:
313 - *startTransaction
314 - &runCommand
315 name: runCommand
316 object: database
317 command_name: find
318 arguments:
319 session: session0
320 command:
321 find: *collection_name
322 - *runCommand
323 - *commitTransaction
324
325 expectations:
326 - command_started_event:
327 command:
328 find: *collection_name
329 lsid: session0
330 readConcern:
331 level: majority
332 txnNumber:
333 $numberLong: "1"
334 startTransaction: true
335 autocommit: false
336 writeConcern:
337 command_name: find
338 database_name: *database_name
339 - command_started_event:
340 command:
341 find: *collection_name
342 lsid: session0
343 readConcern: # No readConcern
344 txnNumber:
345 $numberLong: "1"
346 startTransaction:
347 autocommit: false
348 writeConcern:
349 command_name: find
350 database_name: *database_name
351 - *commitTransactionEvent
352
353 outcome: *outcome
354
355 - description: countDocuments ignores collection readConcern
356
357 operations:
358 - &startTransactionNoReadConcern
359 name: startTransaction
360 object: session0
361 - *countDocuments
362 - *countDocuments
363 - *commitTransaction
364
365 expectations:
366 - command_started_event:
367 command:
368 aggregate: *collection_name
369 pipeline:
370 - $match: {_id: {$gte: 2}}
371 - $group: {_id: 1, n: {$sum: 1}}
372 cursor: {}
373 lsid: session0
374 readConcern: # No readConcern
375 txnNumber:
376 $numberLong: "1"
377 startTransaction: true
378 autocommit: false
379 command_name: aggregate
380 database_name: *database_name
381 - command_started_event:
382 command:
383 aggregate: *collection_name
384 pipeline:
385 - $match: {_id: {$gte: 2}}
386 - $group: {_id: 1, n: {$sum: 1}}
387 cursor: {}
388 lsid: session0
389 readConcern: # No readConcern
390 txnNumber:
391 $numberLong: "1"
392 startTransaction:
393 autocommit: false
394 command_name: aggregate
395 database_name: *database_name
396 - *commitTransactionEvent
397
398 outcome: *outcome
399
400 - description: find ignores collection readConcern
401
402 operations:
403 - *startTransactionNoReadConcern
404 - *find
405 - *find
406 - *commitTransaction
407
408 expectations:
409 - command_started_event:
410 command:
411 find: *collection_name
412 batchSize: 3
413 lsid: session0
414 readConcern: # No readConcern
415 txnNumber:
416 $numberLong: "1"
417 startTransaction: true
418 autocommit: false
419 command_name: find
420 database_name: *database_name
421 - command_started_event:
422 command:
423 getMore:
424 # 42 is a fake placeholder value for the cursorId.
425 $numberLong: '42'
426 collection: *collection_name
427 batchSize: 3
428 lsid: session0
429 readConcern: # No readConcern
430 txnNumber:
431 $numberLong: "1"
432 startTransaction:
433 autocommit: false
434 command_name: getMore
435 database_name: *database_name
436 - command_started_event:
437 command:
438 find: *collection_name
439 batchSize: 3
440 lsid: session0
441 readConcern: # No readConcern
442 txnNumber:
443 $numberLong: "1"
444 startTransaction:
445 autocommit: false
446 command_name: find
447 database_name: *database_name
448 - command_started_event:
449 command:
450 getMore:
451 $numberLong: '42'
452 collection: *collection_name
453 batchSize: 3
454 lsid: session0
455 readConcern: # No readConcern
456 txnNumber:
457 $numberLong: "1"
458 startTransaction:
459 autocommit: false
460 command_name: getMore
461 database_name: *database_name
462 - *commitTransactionEvent
463
464 outcome: *outcome
465
466 - description: aggregate ignores collection readConcern
467
468 operations:
469 - *startTransactionNoReadConcern
470 - *aggregate
471 - *aggregate
472 - *commitTransaction
473
474 expectations:
475 - command_started_event:
476 command:
477 aggregate: *collection_name
478 pipeline:
479 - $project:
480 _id: 1
481 cursor:
482 batchSize: 3
483 lsid: session0
484 readConcern: # No readConcern
485 txnNumber:
486 $numberLong: "1"
487 startTransaction: true
488 autocommit: false
489 command_name: aggregate
490 database_name: *database_name
491 - command_started_event:
492 command:
493 getMore:
494 # 42 is a fake placeholder value for the cursorId.
495 $numberLong: '42'
496 collection: *collection_name
497 batchSize: 3
498 lsid: session0
499 readConcern: # No readConcern
500 txnNumber:
501 $numberLong: "1"
502 startTransaction:
503 autocommit: false
504 command_name: getMore
505 database_name: *database_name
506 - command_started_event:
507 command:
508 aggregate: *collection_name
509 pipeline:
510 - $project:
511 _id: 1
512 cursor:
513 batchSize: 3
514 lsid: session0
515 readConcern: # No readConcern
516 txnNumber:
517 $numberLong: "1"
518 startTransaction:
519 autocommit: false
520 command_name: aggregate
521 database_name: *database_name
522 - command_started_event:
523 command:
524 getMore:
525 $numberLong: '42'
526 collection: *collection_name
527 batchSize: 3
528 lsid: session0
529 readConcern: # No readConcern
530 txnNumber:
531 $numberLong: "1"
532 startTransaction:
533 autocommit: false
534 command_name: getMore
535 database_name: *database_name
536 - *commitTransactionEvent
537
538 outcome: *outcome
539
540 - description: distinct ignores collection readConcern
541
542 operations:
543 - *startTransactionNoReadConcern
544 - *distinct
545 - *distinct
546 - *commitTransaction
547
548 expectations:
549 - command_started_event:
550 command:
551 distinct: *collection_name
552 key: _id
553 lsid: session0
554 readConcern: # No readConcern
555 txnNumber:
556 $numberLong: "1"
557 startTransaction: true
558 autocommit: false
559 writeConcern:
560 command_name: distinct
561 database_name: *database_name
562 - command_started_event:
563 command:
564 distinct: *collection_name
565 key: _id
566 lsid: session0
567 readConcern: # No readConcern
568 txnNumber:
569 $numberLong: "1"
570 startTransaction:
571 autocommit: false
572 writeConcern:
573 command_name: distinct
574 database_name: *database_name
575 - *commitTransactionEvent
576
577 outcome: *outcome
578
579 - description: runCommand ignores database readConcern
580
581 operations:
582 - *startTransactionNoReadConcern
583 - name: runCommand
584 object: database
585 databaseOptions:
586 readConcern:
587 level: majority
588 command_name: find
589 arguments:
590 session: session0
591 command:
592 find: *collection_name
593 - *runCommand
594 - *commitTransaction
595
596 expectations:
597 - command_started_event:
598 command:
599 find: *collection_name
600 lsid: session0
601 readConcern: # No readConcern
602 txnNumber:
603 $numberLong: "1"
604 startTransaction: true
605 autocommit: false
606 writeConcern:
607 command_name: find
608 database_name: *database_name
609 - command_started_event:
610 command:
611 find: *collection_name
612 lsid: session0
613 readConcern: # No readConcern
614 txnNumber:
615 $numberLong: "1"
616 startTransaction:
617 autocommit: false
618 writeConcern:
619 command_name: find
620 database_name: *database_name
621 - *commitTransactionEvent
622
623 outcome: *outcome