mongo 2.7.0 → 2.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +39 -14
  5. data/Rakefile +1 -0
  6. data/lib/mongo/auth.rb +4 -1
  7. data/lib/mongo/client.rb +4 -3
  8. data/lib/mongo/cluster.rb +1 -1
  9. data/lib/mongo/collection/view/readable.rb +5 -2
  10. data/lib/mongo/database.rb +1 -0
  11. data/lib/mongo/error/invalid_server_preference.rb +1 -0
  12. data/lib/mongo/error/operation_failure.rb +10 -0
  13. data/lib/mongo/error/parser.rb +10 -0
  14. data/lib/mongo/event.rb +1 -2
  15. data/lib/mongo/operation/result.rb +4 -1
  16. data/lib/mongo/operation/shared/executable_transaction_label.rb +3 -1
  17. data/lib/mongo/operation/shared/sessions_supported.rb +1 -1
  18. data/lib/mongo/protocol/msg.rb +1 -1
  19. data/lib/mongo/protocol/query.rb +2 -2
  20. data/lib/mongo/retryable.rb +20 -6
  21. data/lib/mongo/server.rb +6 -0
  22. data/lib/mongo/server/connection.rb +4 -4
  23. data/lib/mongo/server/monitor/connection.rb +9 -5
  24. data/lib/mongo/server_selector/selectable.rb +86 -32
  25. data/lib/mongo/session.rb +98 -15
  26. data/lib/mongo/version.rb +1 -1
  27. data/spec/README.md +85 -0
  28. data/spec/integration/bulk_insert_spec.rb +1 -1
  29. data/spec/integration/change_stream_examples_spec.rb +3 -1
  30. data/spec/integration/change_stream_spec.rb +10 -14
  31. data/spec/integration/client_construction_spec.rb +1 -0
  32. data/spec/integration/command_monitoring_spec.rb +37 -1
  33. data/spec/integration/command_spec.rb +141 -0
  34. data/spec/integration/connection_spec.rb +4 -2
  35. data/spec/integration/cursor_reaping_spec.rb +1 -1
  36. data/spec/integration/docs_examples_spec.rb +1 -1
  37. data/spec/integration/retryable_writes_spec.rb +33 -42
  38. data/spec/integration/server_description_spec.rb +3 -3
  39. data/spec/integration/server_selector_spec.rb +79 -0
  40. data/spec/lite_spec_helper.rb +4 -2
  41. data/spec/mongo/address_spec.rb +8 -0
  42. data/spec/mongo/auth/cr_spec.rb +5 -2
  43. data/spec/mongo/auth/invalid_mechanism_spec.rb +11 -0
  44. data/spec/mongo/auth/scram/conversation_spec.rb +3 -2
  45. data/spec/mongo/auth/scram/negotiation_spec.rb +1 -2
  46. data/spec/mongo/auth/scram_spec.rb +11 -6
  47. data/spec/mongo/auth/user/view_spec.rb +13 -6
  48. data/spec/mongo/bulk_write_spec.rb +81 -104
  49. data/spec/mongo/client_construction_spec.rb +18 -7
  50. data/spec/mongo/client_spec.rb +11 -7
  51. data/spec/mongo/cluster_spec.rb +30 -1
  52. data/spec/mongo/collection/view/aggregation_spec.rb +18 -10
  53. data/spec/mongo/collection/view/change_stream_spec.rb +28 -8
  54. data/spec/mongo/collection/view/map_reduce_spec.rb +24 -10
  55. data/spec/mongo/collection/view/readable_spec.rb +37 -19
  56. data/spec/mongo/collection/view/writable_spec.rb +64 -32
  57. data/spec/mongo/collection/view_spec.rb +4 -2
  58. data/spec/mongo/collection_spec.rb +163 -73
  59. data/spec/mongo/cursor_spec.rb +5 -2
  60. data/spec/mongo/database_spec.rb +41 -19
  61. data/spec/mongo/error/no_server_available_spec.rb +1 -1
  62. data/spec/mongo/error/parser_spec.rb +29 -0
  63. data/spec/mongo/grid/stream/write_spec.rb +2 -1
  64. data/spec/mongo/index/view_spec.rb +42 -24
  65. data/spec/mongo/operation/delete/op_msg_spec.rb +11 -7
  66. data/spec/mongo/operation/insert/op_msg_spec.rb +10 -6
  67. data/spec/mongo/operation/update/op_msg_spec.rb +10 -6
  68. data/spec/mongo/protocol/compressed_spec.rb +1 -1
  69. data/spec/mongo/protocol/msg_spec.rb +1 -1
  70. data/spec/mongo/server/app_metadata_spec.rb +2 -1
  71. data/spec/mongo/server/connection_auth_spec.rb +1 -1
  72. data/spec/mongo/server/monitor/connection_spec.rb +42 -0
  73. data/spec/mongo/server_selector_spec.rb +17 -0
  74. data/spec/mongo/server_spec.rb +110 -0
  75. data/spec/mongo/session/session_pool_spec.rb +1 -1
  76. data/spec/mongo/session_spec.rb +1 -1
  77. data/spec/mongo/session_transaction_spec.rb +162 -1
  78. data/spec/mongo/socket/ssl_spec.rb +14 -7
  79. data/spec/mongo/uri/srv_protocol_spec.rb +41 -34
  80. data/spec/spec_helper.rb +3 -191
  81. data/spec/spec_tests/change_streams_spec.rb +3 -6
  82. data/spec/spec_tests/data/transactions/abort.yml +3 -1
  83. data/spec/spec_tests/data/transactions/commit.yml +4 -3
  84. data/spec/spec_tests/data/transactions/error-labels.yml +17 -13
  85. data/spec/spec_tests/data/transactions/read-concern.yml +611 -0
  86. data/spec/spec_tests/data/transactions/retryable-commit.yml +126 -21
  87. data/spec/spec_tests/data/transactions_api/callback-aborts.yml +42 -39
  88. data/spec/spec_tests/data/transactions_api/callback-commits.yml +52 -50
  89. data/spec/spec_tests/data/transactions_api/callback-retry.yml +33 -31
  90. data/spec/spec_tests/data/transactions_api/commit-retry.yml +42 -39
  91. data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror-4.2.yml +13 -12
  92. data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror.yml +15 -26
  93. data/spec/spec_tests/data/transactions_api/commit-writeconcernerror.yml +25 -33
  94. data/spec/spec_tests/data/transactions_api/commit.yml +44 -42
  95. data/spec/spec_tests/data/transactions_api/transaction-options.yml +25 -23
  96. data/spec/spec_tests/max_staleness_spec.rb +2 -0
  97. data/spec/spec_tests/retryable_writes_spec.rb +2 -6
  98. data/spec/spec_tests/sdam_spec.rb +2 -0
  99. data/spec/spec_tests/server_selection_spec.rb +3 -0
  100. data/spec/spec_tests/transactions_api_spec.rb +7 -1
  101. data/spec/spec_tests/transactions_spec.rb +6 -0
  102. data/spec/spec_tests/uri_options_spec.rb +4 -26
  103. data/spec/support/certificates/ca.pem +21 -16
  104. data/spec/support/certificates/client.pem +90 -90
  105. data/spec/support/certificates/client_cert.pem +21 -20
  106. data/spec/support/certificates/client_key.pem +27 -28
  107. data/spec/support/certificates/client_key_encrypted.pem +26 -26
  108. data/spec/support/certificates/crl.pem +10 -8
  109. data/spec/support/certificates/crl_client_revoked.pem +11 -10
  110. data/spec/support/certificates/server.pem +48 -33
  111. data/spec/support/change_streams.rb +12 -32
  112. data/spec/support/client_registry.rb +12 -1
  113. data/spec/support/cluster_config.rb +48 -2
  114. data/spec/support/common_shortcuts.rb +73 -7
  115. data/spec/support/connection_string.rb +0 -3
  116. data/spec/support/constraints.rb +87 -22
  117. data/spec/support/crud.rb +2 -1
  118. data/spec/support/shared/server_selector.rb +0 -28
  119. data/spec/support/shared/session.rb +25 -14
  120. data/spec/support/transactions.rb +4 -8
  121. data/spec/support/transactions/operation.rb +26 -4
  122. data/spec/support/transactions/verifier.rb +5 -2
  123. metadata +496 -488
  124. metadata.gz.sig +5 -2
  125. data/spec/support/certificates/password_protected.pem +0 -51
@@ -11,19 +11,16 @@ describe 'ChangeStreams' do
11
11
  spec.tests.each do |test|
12
12
 
13
13
  context(test.description) do
14
+ require_topology *test.topologies
14
15
 
15
16
  before(:each) do
16
- unless test.configuration_satisfied?(authorized_client)
17
- skip 'Version or topology requirements not satisfied'
17
+ unless test.server_version_satisfied?(authorized_client)
18
+ skip 'Version requirements not satisfied'
18
19
  end
19
20
 
20
21
  test.setup_test
21
22
  end
22
23
 
23
- after(:each) do
24
- test.teardown_test if test.configuration_satisfied?(authorized_client)
25
- end
26
-
27
24
  let(:result) do
28
25
  test.run
29
26
  end
@@ -297,7 +297,9 @@ tests:
297
297
  document:
298
298
  _id: 1
299
299
  result:
300
- errorCodeName: DuplicateKey
300
+ # Don't assert on errorCodeName because (after SERVER-38583) the
301
+ # DuplicateKey is reported in writeErrors, not as a top-level
302
+ # command error.
301
303
  errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
302
304
  # Make sure the server aborted the transaction.
303
305
  - name: insertOne
@@ -204,7 +204,8 @@ tests:
204
204
  $numberLong: "1"
205
205
  startTransaction:
206
206
  autocommit: false
207
- writeConcern:
207
+ # commitTransaction applies w:majority on retries
208
+ writeConcern: { w: majority, wtimeout: 10000 }
208
209
  command_name: commitTransaction
209
210
  database_name: admin
210
211
  - command_started_event:
@@ -215,7 +216,7 @@ tests:
215
216
  $numberLong: "1"
216
217
  startTransaction:
217
218
  autocommit: false
218
- writeConcern:
219
+ writeConcern: { w: majority, wtimeout: 10000 }
219
220
  command_name: commitTransaction
220
221
  database_name: admin
221
222
 
@@ -225,7 +226,7 @@ tests:
225
226
  - _id: 1
226
227
 
227
228
  - description: write concern error on commit
228
-
229
+ skipReason: "SERVER-37458 Mongos does not yet support writeConcern on commit"
229
230
  operations:
230
231
  - name: startTransaction
231
232
  object: session0
@@ -17,7 +17,9 @@ tests:
17
17
  - _id: 1
18
18
  - _id: 1
19
19
  result:
20
- errorCodeName: DuplicateKey
20
+ # Don't assert on errorCodeName because (after SERVER-38583) the
21
+ # DuplicateKey is reported in writeErrors, not as a top-level
22
+ # command error.
21
23
  errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
22
24
  - name: abortTransaction
23
25
  object: session0
@@ -460,7 +462,8 @@ tests:
460
462
  $numberLong: "1"
461
463
  startTransaction:
462
464
  autocommit: false
463
- writeConcern:
465
+ # commitTransaction applies w:majority on retries
466
+ writeConcern: { w: majority, wtimeout: 10000 }
464
467
  command_name: commitTransaction
465
468
  database_name: admin
466
469
  - command_started_event:
@@ -471,7 +474,7 @@ tests:
471
474
  $numberLong: "1"
472
475
  startTransaction:
473
476
  autocommit: false
474
- writeConcern:
477
+ writeConcern: { w: majority, wtimeout: 10000 }
475
478
  command_name: commitTransaction
476
479
  database_name: admin
477
480
 
@@ -543,7 +546,8 @@ tests:
543
546
  $numberLong: "1"
544
547
  startTransaction:
545
548
  autocommit: false
546
- writeConcern:
549
+ # commitTransaction applies w:majority on retries
550
+ writeConcern: { w: majority, wtimeout: 10000 }
547
551
  command_name: commitTransaction
548
552
  database_name: admin
549
553
  - command_started_event:
@@ -554,7 +558,7 @@ tests:
554
558
  $numberLong: "1"
555
559
  startTransaction:
556
560
  autocommit: false
557
- writeConcern:
561
+ writeConcern: { w: majority, wtimeout: 10000 }
558
562
  command_name: commitTransaction
559
563
  database_name: admin
560
564
 
@@ -633,8 +637,8 @@ tests:
633
637
  $numberLong: "1"
634
638
  startTransaction:
635
639
  autocommit: false
636
- writeConcern:
637
- w: majority
640
+ # commitTransaction applies w:majority on retries
641
+ writeConcern: { w: majority, wtimeout: 10000 }
638
642
  command_name: commitTransaction
639
643
  database_name: admin
640
644
  - command_started_event:
@@ -645,8 +649,8 @@ tests:
645
649
  $numberLong: "1"
646
650
  startTransaction:
647
651
  autocommit: false
648
- writeConcern:
649
- w: majority
652
+ # commitTransaction applies w:majority on retries
653
+ writeConcern: { w: majority, wtimeout: 10000 }
650
654
  command_name: commitTransaction
651
655
  database_name: admin
652
656
 
@@ -725,8 +729,8 @@ tests:
725
729
  $numberLong: "1"
726
730
  startTransaction:
727
731
  autocommit: false
728
- writeConcern:
729
- w: majority
732
+ # commitTransaction applies w:majority on retries
733
+ writeConcern: { w: majority, wtimeout: 10000 }
730
734
  command_name: commitTransaction
731
735
  database_name: admin
732
736
 
@@ -807,8 +811,8 @@ tests:
807
811
  $numberLong: "1"
808
812
  startTransaction:
809
813
  autocommit: false
810
- writeConcern:
811
- w: majority
814
+ # commitTransaction applies w:majority on retries
815
+ writeConcern: { w: majority, wtimeout: 10000 }
812
816
  command_name: commitTransaction
813
817
  database_name: admin
814
818
 
@@ -0,0 +1,611 @@
1
+ database_name: &database_name "ruby-driver"
2
+ collection_name: &collection_name "transactions-tests"
3
+
4
+ data: &data
5
+ - {_id: 1}
6
+ - {_id: 2}
7
+ - {_id: 3}
8
+ - {_id: 4}
9
+
10
+ tests:
11
+ - description: only first countDocuments includes readConcern
12
+
13
+ operations:
14
+ - &startTransaction
15
+ name: startTransaction
16
+ object: session0
17
+ arguments:
18
+ options:
19
+ readConcern:
20
+ level: snapshot
21
+ - &countDocuments
22
+ name: countDocuments
23
+ object: collection
24
+ collectionOptions:
25
+ readConcern:
26
+ level: majority
27
+ arguments:
28
+ session: session0
29
+ filter: {_id: {$gte: 2}}
30
+ result: 3
31
+ - *countDocuments
32
+ - &commitTransaction
33
+ name: commitTransaction
34
+ object: session0
35
+
36
+ expectations:
37
+ - command_started_event:
38
+ command:
39
+ aggregate: *collection_name
40
+ pipeline:
41
+ - $match: {_id: {$gte: 2}}
42
+ - $group: {_id: null, n: {$sum: 1}}
43
+ lsid: session0
44
+ readConcern:
45
+ level: snapshot
46
+ txnNumber:
47
+ $numberLong: "1"
48
+ startTransaction: true
49
+ autocommit: false
50
+ command_name: aggregate
51
+ database_name: *database_name
52
+ - command_started_event:
53
+ command:
54
+ aggregate: *collection_name
55
+ pipeline:
56
+ - $match: {_id: {$gte: 2}}
57
+ - $group: {_id: null, n: {$sum: 1}}
58
+ lsid: session0
59
+ readConcern: # No readConcern
60
+ txnNumber:
61
+ $numberLong: "1"
62
+ startTransaction:
63
+ autocommit: false
64
+ command_name: aggregate
65
+ database_name: *database_name
66
+ - &commitTransactionEvent
67
+ command_started_event:
68
+ command:
69
+ commitTransaction: 1
70
+ lsid: session0
71
+ readConcern:
72
+ txnNumber:
73
+ $numberLong: "1"
74
+ startTransaction:
75
+ autocommit: false
76
+ writeConcern:
77
+ command_name: commitTransaction
78
+ database_name: admin
79
+
80
+ outcome: &outcome
81
+ collection:
82
+ data:
83
+ *data
84
+
85
+ - description: only first find includes readConcern
86
+
87
+ operations:
88
+ - *startTransaction
89
+ - &find
90
+ name: find
91
+ object: collection
92
+ collectionOptions:
93
+ readConcern:
94
+ level: majority
95
+ arguments:
96
+ session: session0
97
+ batchSize: 3
98
+ result: *data
99
+ - *find
100
+ - *commitTransaction
101
+
102
+ expectations:
103
+ - command_started_event:
104
+ command:
105
+ find: *collection_name
106
+ batchSize: 3
107
+ lsid: session0
108
+ readConcern:
109
+ level: snapshot
110
+ txnNumber:
111
+ $numberLong: "1"
112
+ startTransaction: true
113
+ autocommit: false
114
+ command_name: find
115
+ database_name: *database_name
116
+ - command_started_event:
117
+ command:
118
+ getMore:
119
+ # 42 is a fake placeholder value for the cursorId.
120
+ $numberLong: '42'
121
+ collection: *collection_name
122
+ batchSize: 3
123
+ lsid: session0
124
+ readConcern: # No readConcern
125
+ txnNumber:
126
+ $numberLong: "1"
127
+ startTransaction:
128
+ autocommit: false
129
+ command_name: getMore
130
+ database_name: *database_name
131
+ - command_started_event:
132
+ command:
133
+ find: *collection_name
134
+ batchSize: 3
135
+ lsid: session0
136
+ readConcern: # No readConcern
137
+ txnNumber:
138
+ $numberLong: "1"
139
+ startTransaction:
140
+ autocommit: false
141
+ command_name: find
142
+ database_name: *database_name
143
+ - command_started_event:
144
+ command:
145
+ getMore:
146
+ $numberLong: '42'
147
+ collection: *collection_name
148
+ batchSize: 3
149
+ lsid: session0
150
+ readConcern: # No readConcern
151
+ txnNumber:
152
+ $numberLong: "1"
153
+ startTransaction:
154
+ autocommit: false
155
+ command_name: getMore
156
+ database_name: *database_name
157
+ - *commitTransactionEvent
158
+
159
+ outcome: &outcome
160
+ collection:
161
+ data:
162
+ *data
163
+
164
+ - description: only first aggregate includes readConcern
165
+
166
+ operations:
167
+ - *startTransaction
168
+ - &aggregate
169
+ name: aggregate
170
+ object: collection
171
+ collectionOptions:
172
+ readConcern:
173
+ level: majority
174
+ arguments:
175
+ pipeline:
176
+ - $project:
177
+ _id: 1
178
+ batchSize: 3
179
+ session: session0
180
+ result: *data
181
+ - *aggregate
182
+ - *commitTransaction
183
+
184
+ expectations:
185
+ - command_started_event:
186
+ command:
187
+ aggregate: *collection_name
188
+ pipeline:
189
+ - $project:
190
+ _id: 1
191
+ cursor:
192
+ batchSize: 3
193
+ lsid: session0
194
+ readConcern:
195
+ level: snapshot
196
+ txnNumber:
197
+ $numberLong: "1"
198
+ startTransaction: true
199
+ autocommit: false
200
+ command_name: aggregate
201
+ database_name: *database_name
202
+ - command_started_event:
203
+ command:
204
+ getMore:
205
+ # 42 is a fake placeholder value for the cursorId.
206
+ $numberLong: '42'
207
+ collection: *collection_name
208
+ batchSize: 3
209
+ lsid: session0
210
+ readConcern: # No readConcern
211
+ txnNumber:
212
+ $numberLong: "1"
213
+ startTransaction:
214
+ autocommit: false
215
+ command_name: getMore
216
+ database_name: *database_name
217
+ - command_started_event:
218
+ command:
219
+ aggregate: *collection_name
220
+ pipeline:
221
+ - $project:
222
+ _id: 1
223
+ cursor:
224
+ batchSize: 3
225
+ lsid: session0
226
+ readConcern: # No readConcern
227
+ txnNumber:
228
+ $numberLong: "1"
229
+ startTransaction:
230
+ autocommit: false
231
+ command_name: aggregate
232
+ database_name: *database_name
233
+ - command_started_event:
234
+ command:
235
+ getMore:
236
+ $numberLong: '42'
237
+ collection: *collection_name
238
+ batchSize: 3
239
+ lsid: session0
240
+ readConcern: # No readConcern
241
+ txnNumber:
242
+ $numberLong: "1"
243
+ startTransaction:
244
+ autocommit: false
245
+ command_name: getMore
246
+ database_name: *database_name
247
+ - *commitTransactionEvent
248
+
249
+ outcome: *outcome
250
+
251
+ - description: only first distinct includes readConcern
252
+
253
+ operations:
254
+ - *startTransaction
255
+ - &distinct
256
+ name: distinct
257
+ object: collection
258
+ collectionOptions:
259
+ readConcern:
260
+ level: majority
261
+ arguments:
262
+ session: session0
263
+ fieldName: _id
264
+ result: [1, 2, 3, 4]
265
+ - *distinct
266
+ - *commitTransaction
267
+
268
+ expectations:
269
+ - command_started_event:
270
+ command:
271
+ distinct: *collection_name
272
+ key: _id
273
+ lsid: session0
274
+ readConcern:
275
+ level: snapshot
276
+ txnNumber:
277
+ $numberLong: "1"
278
+ startTransaction: true
279
+ autocommit: false
280
+ writeConcern:
281
+ command_name: distinct
282
+ database_name: *database_name
283
+ - command_started_event:
284
+ command:
285
+ distinct: *collection_name
286
+ key: _id
287
+ lsid: session0
288
+ readConcern: # No readConcern
289
+ txnNumber:
290
+ $numberLong: "1"
291
+ startTransaction:
292
+ autocommit: false
293
+ writeConcern:
294
+ command_name: distinct
295
+ database_name: *database_name
296
+ - *commitTransactionEvent
297
+
298
+ outcome: *outcome
299
+
300
+ - description: only first runCommand includes readConcern
301
+
302
+ operations:
303
+ - *startTransaction
304
+ - &runCommand
305
+ name: runCommand
306
+ object: database
307
+ command_name: find
308
+ arguments:
309
+ session: session0
310
+ command:
311
+ find: *collection_name
312
+ - *runCommand
313
+ - *commitTransaction
314
+
315
+ expectations:
316
+ - command_started_event:
317
+ command:
318
+ find: *collection_name
319
+ lsid: session0
320
+ readConcern:
321
+ level: snapshot
322
+ txnNumber:
323
+ $numberLong: "1"
324
+ startTransaction: true
325
+ autocommit: false
326
+ writeConcern:
327
+ command_name: find
328
+ database_name: *database_name
329
+ - command_started_event:
330
+ command:
331
+ find: *collection_name
332
+ lsid: session0
333
+ readConcern: # No readConcern
334
+ txnNumber:
335
+ $numberLong: "1"
336
+ startTransaction:
337
+ autocommit: false
338
+ writeConcern:
339
+ command_name: find
340
+ database_name: *database_name
341
+ - *commitTransactionEvent
342
+
343
+ outcome: *outcome
344
+
345
+ - description: countDocuments ignores collection readConcern
346
+
347
+ operations:
348
+ - &startTransactionNoReadConcern
349
+ name: startTransaction
350
+ object: session0
351
+ - *countDocuments
352
+ - *countDocuments
353
+ - *commitTransaction
354
+
355
+ expectations:
356
+ - command_started_event:
357
+ command:
358
+ aggregate: *collection_name
359
+ pipeline:
360
+ - $match: {_id: {$gte: 2}}
361
+ - $group: {_id: null, n: {$sum: 1}}
362
+ lsid: session0
363
+ readConcern: # No readConcern
364
+ txnNumber:
365
+ $numberLong: "1"
366
+ startTransaction: true
367
+ autocommit: false
368
+ command_name: aggregate
369
+ database_name: *database_name
370
+ - command_started_event:
371
+ command:
372
+ aggregate: *collection_name
373
+ pipeline:
374
+ - $match: {_id: {$gte: 2}}
375
+ - $group: {_id: null, n: {$sum: 1}}
376
+ lsid: session0
377
+ readConcern: # No readConcern
378
+ txnNumber:
379
+ $numberLong: "1"
380
+ startTransaction:
381
+ autocommit: false
382
+ command_name: aggregate
383
+ database_name: *database_name
384
+ - *commitTransactionEvent
385
+
386
+ outcome: *outcome
387
+
388
+ - description: find ignores collection readConcern
389
+
390
+ operations:
391
+ - *startTransactionNoReadConcern
392
+ - *find
393
+ - *find
394
+ - *commitTransaction
395
+
396
+ expectations:
397
+ - command_started_event:
398
+ command:
399
+ find: *collection_name
400
+ batchSize: 3
401
+ lsid: session0
402
+ readConcern: # No readConcern
403
+ txnNumber:
404
+ $numberLong: "1"
405
+ startTransaction: true
406
+ autocommit: false
407
+ command_name: find
408
+ database_name: *database_name
409
+ - command_started_event:
410
+ command:
411
+ getMore:
412
+ # 42 is a fake placeholder value for the cursorId.
413
+ $numberLong: '42'
414
+ collection: *collection_name
415
+ batchSize: 3
416
+ lsid: session0
417
+ readConcern: # No readConcern
418
+ txnNumber:
419
+ $numberLong: "1"
420
+ startTransaction:
421
+ autocommit: false
422
+ command_name: getMore
423
+ database_name: *database_name
424
+ - command_started_event:
425
+ command:
426
+ find: *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: find
435
+ database_name: *database_name
436
+ - command_started_event:
437
+ command:
438
+ getMore:
439
+ $numberLong: '42'
440
+ collection: *collection_name
441
+ batchSize: 3
442
+ lsid: session0
443
+ readConcern: # No readConcern
444
+ txnNumber:
445
+ $numberLong: "1"
446
+ startTransaction:
447
+ autocommit: false
448
+ command_name: getMore
449
+ database_name: *database_name
450
+ - *commitTransactionEvent
451
+
452
+ outcome: *outcome
453
+
454
+ - description: aggregate ignores collection readConcern
455
+
456
+ operations:
457
+ - *startTransactionNoReadConcern
458
+ - *aggregate
459
+ - *aggregate
460
+ - *commitTransaction
461
+
462
+ expectations:
463
+ - command_started_event:
464
+ command:
465
+ aggregate: *collection_name
466
+ pipeline:
467
+ - $project:
468
+ _id: 1
469
+ cursor:
470
+ batchSize: 3
471
+ lsid: session0
472
+ readConcern: # No readConcern
473
+ txnNumber:
474
+ $numberLong: "1"
475
+ startTransaction: true
476
+ autocommit: false
477
+ command_name: aggregate
478
+ database_name: *database_name
479
+ - command_started_event:
480
+ command:
481
+ getMore:
482
+ # 42 is a fake placeholder value for the cursorId.
483
+ $numberLong: '42'
484
+ collection: *collection_name
485
+ batchSize: 3
486
+ lsid: session0
487
+ readConcern: # No readConcern
488
+ txnNumber:
489
+ $numberLong: "1"
490
+ startTransaction:
491
+ autocommit: false
492
+ command_name: getMore
493
+ database_name: *database_name
494
+ - command_started_event:
495
+ command:
496
+ aggregate: *collection_name
497
+ pipeline:
498
+ - $project:
499
+ _id: 1
500
+ cursor:
501
+ batchSize: 3
502
+ lsid: session0
503
+ readConcern: # No readConcern
504
+ txnNumber:
505
+ $numberLong: "1"
506
+ startTransaction:
507
+ autocommit: false
508
+ command_name: aggregate
509
+ database_name: *database_name
510
+ - command_started_event:
511
+ command:
512
+ getMore:
513
+ $numberLong: '42'
514
+ collection: *collection_name
515
+ batchSize: 3
516
+ lsid: session0
517
+ readConcern: # No readConcern
518
+ txnNumber:
519
+ $numberLong: "1"
520
+ startTransaction:
521
+ autocommit: false
522
+ command_name: getMore
523
+ database_name: *database_name
524
+ - *commitTransactionEvent
525
+
526
+ outcome: *outcome
527
+
528
+ - description: distinct ignores collection readConcern
529
+
530
+ operations:
531
+ - *startTransactionNoReadConcern
532
+ - *distinct
533
+ - *distinct
534
+ - *commitTransaction
535
+
536
+ expectations:
537
+ - command_started_event:
538
+ command:
539
+ distinct: *collection_name
540
+ key: _id
541
+ lsid: session0
542
+ readConcern: # No readConcern
543
+ txnNumber:
544
+ $numberLong: "1"
545
+ startTransaction: true
546
+ autocommit: false
547
+ writeConcern:
548
+ command_name: distinct
549
+ database_name: *database_name
550
+ - command_started_event:
551
+ command:
552
+ distinct: *collection_name
553
+ key: _id
554
+ lsid: session0
555
+ readConcern: # No readConcern
556
+ txnNumber:
557
+ $numberLong: "1"
558
+ startTransaction:
559
+ autocommit: false
560
+ writeConcern:
561
+ command_name: distinct
562
+ database_name: *database_name
563
+ - *commitTransactionEvent
564
+
565
+ outcome: *outcome
566
+
567
+ - description: runCommand ignores database readConcern
568
+
569
+ operations:
570
+ - *startTransactionNoReadConcern
571
+ - name: runCommand
572
+ object: database
573
+ databaseOptions:
574
+ readConcern:
575
+ level: majority
576
+ command_name: find
577
+ arguments:
578
+ session: session0
579
+ command:
580
+ find: *collection_name
581
+ - *runCommand
582
+ - *commitTransaction
583
+
584
+ expectations:
585
+ - command_started_event:
586
+ command:
587
+ find: *collection_name
588
+ lsid: session0
589
+ readConcern: # No readConcern
590
+ txnNumber:
591
+ $numberLong: "1"
592
+ startTransaction: true
593
+ autocommit: false
594
+ writeConcern:
595
+ command_name: find
596
+ database_name: *database_name
597
+ - command_started_event:
598
+ command:
599
+ find: *collection_name
600
+ lsid: session0
601
+ readConcern: # No readConcern
602
+ txnNumber:
603
+ $numberLong: "1"
604
+ startTransaction:
605
+ autocommit: false
606
+ writeConcern:
607
+ command_name: find
608
+ database_name: *database_name
609
+ - *commitTransactionEvent
610
+
611
+ outcome: *outcome