mongo 2.9.2 → 2.10.0.rc0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/mongo.rb +1 -0
  5. data/lib/mongo/auth/user/view.rb +4 -4
  6. data/lib/mongo/bulk_write.rb +14 -8
  7. data/lib/mongo/bulk_write/result.rb +1 -1
  8. data/lib/mongo/bulk_write/result_combiner.rb +2 -2
  9. data/lib/mongo/bulk_write/transformable.rb +17 -9
  10. data/lib/mongo/client.rb +107 -16
  11. data/lib/mongo/cluster.rb +47 -25
  12. data/lib/mongo/cluster/topology/replica_set_no_primary.rb +1 -1
  13. data/lib/mongo/cluster_time.rb +139 -0
  14. data/lib/mongo/collection.rb +84 -25
  15. data/lib/mongo/collection/view.rb +7 -3
  16. data/lib/mongo/collection/view/aggregation.rb +4 -4
  17. data/lib/mongo/collection/view/builder/aggregation.rb +31 -6
  18. data/lib/mongo/collection/view/builder/find_command.rb +4 -1
  19. data/lib/mongo/collection/view/builder/map_reduce.rb +4 -1
  20. data/lib/mongo/collection/view/change_stream.rb +54 -66
  21. data/lib/mongo/collection/view/iterable.rb +2 -2
  22. data/lib/mongo/collection/view/map_reduce.rb +6 -4
  23. data/lib/mongo/collection/view/readable.rb +36 -16
  24. data/lib/mongo/collection/view/writable.rb +68 -22
  25. data/lib/mongo/cursor.rb +87 -20
  26. data/lib/mongo/database.rb +47 -43
  27. data/lib/mongo/database/view.rb +54 -11
  28. data/lib/mongo/error.rb +13 -4
  29. data/lib/mongo/error/invalid_write_concern.rb +2 -2
  30. data/lib/mongo/error/operation_failure.rb +65 -11
  31. data/lib/mongo/error/parser.rb +41 -8
  32. data/lib/mongo/grid/fs_bucket.rb +26 -6
  33. data/lib/mongo/grid/stream/read.rb +9 -2
  34. data/lib/mongo/grid/stream/write.rb +21 -5
  35. data/lib/mongo/index/view.rb +3 -3
  36. data/lib/mongo/lint.rb +10 -3
  37. data/lib/mongo/operation.rb +2 -0
  38. data/lib/mongo/operation/aggregate/result.rb +19 -6
  39. data/lib/mongo/operation/collections_info.rb +1 -1
  40. data/lib/mongo/operation/get_more/result.rb +9 -0
  41. data/lib/mongo/operation/list_collections/command.rb +1 -3
  42. data/lib/mongo/operation/list_collections/op_msg.rb +1 -2
  43. data/lib/mongo/operation/parallel_scan/command.rb +4 -1
  44. data/lib/mongo/operation/parallel_scan/op_msg.rb +4 -1
  45. data/lib/mongo/operation/result.rb +27 -4
  46. data/lib/mongo/operation/shared/executable.rb +19 -5
  47. data/lib/mongo/operation/shared/executable_no_validate.rb +1 -2
  48. data/lib/mongo/operation/shared/executable_transaction_label.rb +0 -9
  49. data/lib/mongo/operation/shared/polymorphic_result.rb +9 -1
  50. data/lib/mongo/operation/shared/result/aggregatable.rb +2 -2
  51. data/lib/mongo/operation/shared/sessions_supported.rb +42 -32
  52. data/lib/mongo/operation/shared/specifiable.rb +40 -0
  53. data/lib/mongo/operation/shared/unpinnable.rb +39 -0
  54. data/lib/mongo/operation/shared/write.rb +1 -1
  55. data/lib/mongo/protocol/update.rb +6 -2
  56. data/lib/mongo/retryable.rb +79 -39
  57. data/lib/mongo/server/connection.rb +10 -3
  58. data/lib/mongo/server/description.rb +25 -1
  59. data/lib/mongo/server/monitor/connection.rb +1 -1
  60. data/lib/mongo/server_selector.rb +10 -0
  61. data/lib/mongo/server_selector/selectable.rb +172 -32
  62. data/lib/mongo/session.rb +654 -581
  63. data/lib/mongo/session/session_pool.rb +1 -1
  64. data/lib/mongo/socket.rb +7 -28
  65. data/lib/mongo/socket/ssl.rb +26 -1
  66. data/lib/mongo/socket/tcp.rb +3 -0
  67. data/lib/mongo/socket/unix.rb +3 -0
  68. data/lib/mongo/uri.rb +112 -265
  69. data/lib/mongo/uri/srv_protocol.rb +4 -1
  70. data/lib/mongo/version.rb +1 -1
  71. data/lib/mongo/write_concern.rb +10 -29
  72. data/lib/mongo/write_concern/acknowledged.rb +12 -0
  73. data/lib/mongo/write_concern/base.rb +17 -13
  74. data/lib/mongo/write_concern/unacknowledged.rb +12 -0
  75. data/spec/atlas/atlas_connectivity_spec.rb +7 -37
  76. data/spec/atlas/operations_spec.rb +25 -0
  77. data/spec/integration/change_stream_examples_spec.rb +45 -31
  78. data/spec/integration/change_stream_spec.rb +305 -5
  79. data/spec/integration/client_spec.rb +44 -0
  80. data/spec/integration/command_monitoring_spec.rb +1 -0
  81. data/spec/integration/command_spec.rb +7 -1
  82. data/spec/integration/mmapv1_spec.rb +28 -0
  83. data/spec/integration/mongos_pinning_spec.rb +34 -0
  84. data/spec/integration/operation_failure_code_spec.rb +2 -2
  85. data/spec/integration/{read_concern.rb → read_concern_spec.rb} +7 -1
  86. data/spec/integration/read_preference_spec.rb +485 -0
  87. data/spec/integration/retryable_writes_spec.rb +8 -19
  88. data/spec/integration/sdam_error_handling_spec.rb +1 -1
  89. data/spec/integration/sdam_events_spec.rb +2 -2
  90. data/spec/integration/server_description_spec.rb +14 -17
  91. data/spec/integration/server_selector_spec.rb +7 -3
  92. data/spec/integration/server_spec.rb +48 -0
  93. data/spec/integration/ssl_uri_options_spec.rb +1 -1
  94. data/spec/integration/step_down_spec.rb +10 -4
  95. data/spec/integration/transactions_examples_spec.rb +11 -10
  96. data/spec/lite_spec_helper.rb +19 -16
  97. data/spec/mongo/auth/scram/negotiation_spec.rb +11 -8
  98. data/spec/mongo/bulk_write/ordered_combiner_spec.rb +6 -6
  99. data/spec/mongo/bulk_write/unordered_combiner_spec.rb +4 -4
  100. data/spec/mongo/bulk_write_spec.rb +12 -2
  101. data/spec/mongo/client_construction_spec.rb +160 -8
  102. data/spec/mongo/client_spec.rb +5 -4
  103. data/spec/mongo/cluster_spec.rb +6 -6
  104. data/spec/mongo/cluster_time_spec.rb +148 -0
  105. data/spec/mongo/collection/view/aggregation_spec.rb +34 -15
  106. data/spec/mongo/collection/view/change_stream_spec.rb +62 -3
  107. data/spec/mongo/collection/view/map_reduce_spec.rb +7 -5
  108. data/spec/mongo/collection/view/readable_spec.rb +4 -4
  109. data/spec/mongo/collection_spec.rb +331 -14
  110. data/spec/mongo/cursor_spec.rb +117 -5
  111. data/spec/mongo/database_spec.rb +240 -8
  112. data/spec/mongo/error/operation_failure_spec.rb +47 -1
  113. data/spec/mongo/error/parser_spec.rb +160 -23
  114. data/spec/mongo/operation/insert/bulk_spec.rb +2 -1
  115. data/spec/mongo/operation/result_spec.rb +27 -0
  116. data/spec/mongo/operation/update/bulk_spec.rb +1 -0
  117. data/spec/mongo/retryable_spec.rb +2 -0
  118. data/spec/mongo/server/app_metadata_spec.rb +2 -2
  119. data/spec/mongo/server/connection_spec.rb +13 -17
  120. data/spec/mongo/server/monitor/connection_spec.rb +13 -10
  121. data/spec/mongo/server_selector_spec.rb +34 -2
  122. data/spec/mongo/session/session_pool_spec.rb +14 -3
  123. data/spec/mongo/session_spec.rb +3 -3
  124. data/spec/mongo/session_transaction_spec.rb +4 -3
  125. data/spec/mongo/socket/ssl_spec.rb +19 -5
  126. data/spec/mongo/socket_spec.rb +1 -62
  127. data/spec/mongo/uri/srv_protocol_spec.rb +14 -20
  128. data/spec/mongo/uri_option_parsing_spec.rb +94 -8
  129. data/spec/mongo/uri_spec.rb +23 -10
  130. data/spec/mongo/write_concern_spec.rb +56 -3
  131. data/spec/spec_tests/change_streams_spec.rb +2 -1
  132. data/spec/spec_tests/cmap_spec.rb +1 -1
  133. data/spec/spec_tests/crud_spec.rb +12 -2
  134. data/spec/spec_tests/data/change_streams/change-streams-errors.yml +24 -1
  135. data/spec/spec_tests/data/change_streams/change-streams.yml +172 -3
  136. data/spec/spec_tests/data/command_monitoring/bulkWrite.yml +1 -1
  137. data/spec/spec_tests/data/command_monitoring/updateMany.yml +0 -2
  138. data/spec/spec_tests/data/command_monitoring/updateOne.yml +0 -5
  139. data/spec/spec_tests/data/crud/read/aggregate-out.yml +0 -6
  140. data/spec/spec_tests/data/crud/read/count-empty.yml +29 -0
  141. data/spec/spec_tests/data/crud/write/bulkWrite-arrayFilters.yml +1 -0
  142. data/spec/spec_tests/data/crud/write/bulkWrite-collation.yml +101 -0
  143. data/spec/spec_tests/data/crud/write/bulkWrite.yml +401 -0
  144. data/spec/spec_tests/data/crud/write/insertMany.yml +58 -2
  145. data/spec/spec_tests/data/crud/write/updateMany-arrayFilters.yml +3 -0
  146. data/spec/spec_tests/data/crud/write/updateOne-arrayFilters.yml +6 -1
  147. data/spec/spec_tests/data/crud_v2/aggregate-merge.yml +103 -0
  148. data/spec/spec_tests/data/crud_v2/aggregate-out-readConcern.yml +110 -0
  149. data/spec/spec_tests/data/crud_v2/bulkWrite-arrayFilters.yml +81 -0
  150. data/spec/spec_tests/data/crud_v2/db-aggregate.yml +38 -0
  151. data/spec/spec_tests/data/crud_v2/updateWithPipelines.yml +92 -0
  152. data/spec/spec_tests/data/retryable_writes/insertOne-serverErrors.yml +2 -2
  153. data/spec/spec_tests/data/transactions/abort.yml +3 -0
  154. data/spec/spec_tests/data/transactions/bulk.yml +3 -8
  155. data/spec/spec_tests/data/transactions/causal-consistency.yml +3 -8
  156. data/spec/spec_tests/data/transactions/commit.yml +3 -1
  157. data/spec/spec_tests/data/transactions/count.yml +3 -0
  158. data/spec/spec_tests/data/transactions/delete.yml +3 -0
  159. data/spec/spec_tests/data/transactions/error-labels.yml +4 -1
  160. data/spec/spec_tests/data/transactions/errors-client.yml +56 -0
  161. data/spec/spec_tests/data/transactions/errors.yml +3 -0
  162. data/spec/spec_tests/data/transactions/findOneAndDelete.yml +3 -0
  163. data/spec/spec_tests/data/transactions/findOneAndReplace.yml +3 -0
  164. data/spec/spec_tests/data/transactions/findOneAndUpdate.yml +3 -0
  165. data/spec/spec_tests/data/transactions/insert.yml +3 -0
  166. data/spec/spec_tests/data/transactions/isolation.yml +3 -0
  167. data/spec/spec_tests/data/transactions/mongos-pin-auto.yml +1671 -0
  168. data/spec/spec_tests/data/transactions/mongos-recovery-token.yml +347 -0
  169. data/spec/spec_tests/data/transactions/pin-mongos.yml +557 -0
  170. data/spec/spec_tests/data/transactions/read-concern.yml +3 -0
  171. data/spec/spec_tests/data/transactions/read-pref.yml +3 -0
  172. data/spec/spec_tests/data/transactions/reads.yml +3 -0
  173. data/spec/spec_tests/data/transactions/retryable-abort.yml +5 -2
  174. data/spec/spec_tests/data/transactions/retryable-commit.yml +4 -1
  175. data/spec/spec_tests/data/transactions/retryable-writes.yml +3 -0
  176. data/spec/spec_tests/data/transactions/run-command.yml +3 -0
  177. data/spec/spec_tests/data/transactions/transaction-options.yml +6 -0
  178. data/spec/spec_tests/data/transactions/update.yml +3 -8
  179. data/spec/spec_tests/data/transactions/write-concern.yml +348 -38
  180. data/spec/spec_tests/data/transactions_api/callback-aborts.yml +6 -0
  181. data/spec/spec_tests/data/transactions_api/callback-commits.yml +5 -0
  182. data/spec/spec_tests/data/transactions_api/callback-retry.yml +7 -2
  183. data/spec/spec_tests/data/transactions_api/commit-retry.yml +70 -15
  184. data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror-4.2.yml +3 -0
  185. data/spec/spec_tests/data/transactions_api/commit-transienttransactionerror.yml +3 -0
  186. data/spec/spec_tests/data/transactions_api/commit-writeconcernerror.yml +59 -109
  187. data/spec/spec_tests/data/transactions_api/commit.yml +5 -0
  188. data/spec/spec_tests/data/transactions_api/transaction-options.yml +10 -0
  189. data/spec/spec_tests/retryable_reads_spec.rb +5 -2
  190. data/spec/spec_tests/retryable_writes_spec.rb +5 -2
  191. data/spec/spec_tests/sdam_monitoring_spec.rb +3 -3
  192. data/spec/spec_tests/sdam_spec.rb +2 -2
  193. data/spec/spec_tests/transactions_api_spec.rb +1 -67
  194. data/spec/spec_tests/transactions_spec.rb +2 -66
  195. data/spec/support/authorization.rb +4 -0
  196. data/spec/support/change_streams.rb +30 -10
  197. data/spec/support/change_streams/operation.rb +27 -0
  198. data/spec/support/client_registry.rb +44 -25
  199. data/spec/support/cluster_config.rb +25 -14
  200. data/spec/support/cluster_tools.rb +32 -10
  201. data/spec/support/command_monitoring.rb +1 -1
  202. data/spec/support/common_shortcuts.rb +30 -0
  203. data/spec/support/connection_string.rb +8 -3
  204. data/spec/support/constraints.rb +34 -0
  205. data/spec/support/crud.rb +31 -16
  206. data/spec/support/crud/context.rb +23 -0
  207. data/spec/support/crud/operation.rb +311 -14
  208. data/spec/support/crud/spec.rb +2 -1
  209. data/spec/support/crud/test.rb +24 -27
  210. data/spec/support/crud/test_base.rb +22 -0
  211. data/spec/support/crud/verifier.rb +15 -1
  212. data/spec/support/event_subscriber.rb +12 -0
  213. data/spec/support/sdam_formatter_integration.rb +12 -6
  214. data/spec/support/shared/server_selector.rb +10 -0
  215. data/spec/support/shared/session.rb +13 -12
  216. data/spec/support/spec_config.rb +32 -22
  217. data/spec/support/spec_setup.rb +2 -2
  218. data/spec/support/transactions.rb +87 -0
  219. data/spec/support/transactions/context.rb +33 -0
  220. data/spec/support/transactions/operation.rb +99 -349
  221. data/spec/support/transactions/spec.rb +1 -3
  222. data/spec/support/transactions/test.rb +110 -49
  223. data/spec/support/utils.rb +74 -1
  224. metadata +52 -10
  225. metadata.gz.sig +0 -0
  226. data/spec/support/crud/read.rb +0 -265
  227. data/spec/support/crud/write.rb +0 -284
@@ -0,0 +1,92 @@
1
+ runOn:
2
+ -
3
+ minServerVersion: "4.1.11"
4
+
5
+ data:
6
+ - { _id: 1, x: 1, y: 1, t: {u: {v: 1}} }
7
+ - { _id: 2, x: 2, y: 1 }
8
+
9
+ collection_name: &collection_name "test"
10
+ database_name: &database_name "crud-tests"
11
+
12
+ tests:
13
+ -
14
+ description: "UpdateOne using pipelines"
15
+ operations:
16
+ -
17
+ name: "updateOne"
18
+ arguments:
19
+ filter: { _id: 1 }
20
+ update: [ { $replaceRoot: { newRoot: "$t" } }, { $addFields: { foo: 1 } } ]
21
+ result:
22
+ matchedCount: 1
23
+ modifiedCount: 1
24
+ upsertedCount: 0
25
+ expectations:
26
+ -
27
+ command_started_event:
28
+ command:
29
+ update: *collection_name
30
+ updates:
31
+ -
32
+ q: { _id: 1 }
33
+ u: [ { $replaceRoot: { newRoot: "$t" } }, { $addFields: { foo: 1 } } ]
34
+ command_name: update
35
+ database_name: *database_name
36
+ outcome:
37
+ collection:
38
+ data:
39
+ - { _id: 1, u: {v: 1}, foo: 1 }
40
+ - { _id: 2, x: 2, y: 1 }
41
+ -
42
+ description: "UpdateMany using pipelines"
43
+ operations:
44
+ -
45
+ name: "updateMany"
46
+ arguments:
47
+ filter: {}
48
+ update: [ { $project: { x: 1 } }, { $addFields: { foo: 1 } } ]
49
+ result:
50
+ matchedCount: 2
51
+ modifiedCount: 2
52
+ upsertedCount: 0
53
+ expectations:
54
+ -
55
+ command_started_event:
56
+ command:
57
+ update: *collection_name
58
+ updates:
59
+ -
60
+ q: { }
61
+ u: [ { $project: { x: 1 } }, { $addFields: { foo: 1 } } ]
62
+ multi: true
63
+ command_name: update
64
+ database_name: *database_name
65
+ outcome:
66
+ collection:
67
+ data:
68
+ - { _id: 1, x: 1, foo: 1 }
69
+ - { _id: 2, x: 2, foo: 1 }
70
+ -
71
+ description: "FindOneAndUpdate using pipelines"
72
+ operations:
73
+ -
74
+ name: "findOneAndUpdate"
75
+ arguments:
76
+ filter: { _id: 1 }
77
+ update: [ { $project: { x: 1 } }, { $addFields: { foo: 1 } } ]
78
+ expectations:
79
+ -
80
+ command_started_event:
81
+ command:
82
+ findAndModify: *collection_name
83
+ update:
84
+ - $project: { x: 1 }
85
+ - $addFields: { foo: 1 }
86
+ command_name: findAndModify
87
+ database_name: *database_name
88
+ outcome:
89
+ collection:
90
+ data:
91
+ - { _id: 1, x: 1, foo: 1 }
92
+ - { _id: 2, x: 2, y: 1 }
@@ -95,7 +95,7 @@ tests:
95
95
  - { _id: 2, x: 22 }
96
96
  - { _id: 3, x: 33 }
97
97
  -
98
- description: "InsertOne succeeds after InterruptedDueToStepDown"
98
+ description: "InsertOne succeeds after InterruptedDueToReplStateChange"
99
99
  failPoint:
100
100
  configureFailPoint: failCommand
101
101
  mode: { times: 1 }
@@ -304,7 +304,7 @@ tests:
304
304
  - { _id: 2, x: 22 }
305
305
  - { _id: 3, x: 33 }
306
306
  -
307
- description: "InsertOne succeeds after WriteConcernError InterruptedDueToStepDown"
307
+ description: "InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange"
308
308
  failPoint:
309
309
  configureFailPoint: failCommand
310
310
  mode: { times: 1 }
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -149,11 +152,8 @@ tests:
149
152
  updates:
150
153
  - q: {_id: 1}
151
154
  u: {$set: {x: 1}}
152
- multi: false
153
- upsert: false
154
155
  - q: {_id: 2}
155
156
  u: {$set: {x: 2}}
156
- multi: false
157
157
  upsert: true
158
158
  ordered: true
159
159
  lsid: session0
@@ -188,12 +188,8 @@ tests:
188
188
  updates:
189
189
  - q: {_id: 1}
190
190
  u: {y: 1}
191
- multi: false
192
- upsert: false
193
191
  - q: {_id: 2}
194
192
  u: {y: 2}
195
- multi: false
196
- upsert: false
197
193
  ordered: true
198
194
  lsid: session0
199
195
  txnNumber:
@@ -227,7 +223,6 @@ tests:
227
223
  - q: {_id: {$gte: 2}}
228
224
  u: {$set: {z: 1}}
229
225
  multi: true
230
- upsert: false
231
226
  ordered: true
232
227
  lsid: session0
233
228
  txnNumber:
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -24,7 +27,6 @@ tests:
24
27
  filter: {_id: 1}
25
28
  update:
26
29
  $inc: {count: 1}
27
- upsert: false
28
30
  result:
29
31
  matchedCount: 1
30
32
  modifiedCount: 1
@@ -45,8 +47,6 @@ tests:
45
47
  updates:
46
48
  - q: {_id: 1}
47
49
  u: {$inc: {count: 1}}
48
- multi: false
49
- upsert: false
50
50
  ordered: true
51
51
  lsid: session0
52
52
  readConcern:
@@ -62,8 +62,6 @@ tests:
62
62
  updates:
63
63
  - q: {_id: 1}
64
64
  u: {$inc: {count: 1}}
65
- multi: false
66
- upsert: false
67
65
  ordered: true
68
66
  readConcern:
69
67
  afterClusterTime: 42
@@ -119,7 +117,6 @@ tests:
119
117
  filter: {_id: 1}
120
118
  update:
121
119
  $inc: {count: 1}
122
- upsert: false
123
120
  result:
124
121
  matchedCount: 1
125
122
  modifiedCount: 1
@@ -147,8 +144,6 @@ tests:
147
144
  updates:
148
145
  - q: {_id: 1}
149
146
  u: {$inc: {count: 1}}
150
- multi: false
151
- upsert: false
152
147
  ordered: true
153
148
  # No afterClusterTime
154
149
  readConcern:
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -231,7 +234,6 @@ tests:
231
234
  - _id: 1
232
235
 
233
236
  - description: write concern error on commit
234
- skipReason: "SERVER-37458 Mongos does not yet support writeConcern on commit"
235
237
  operations:
236
238
  - name: startTransaction
237
239
  object: session0
@@ -3,6 +3,9 @@ runOn:
3
3
  -
4
4
  minServerVersion: "4.0.2"
5
5
  topology: ["replicaset"]
6
+ -
7
+ minServerVersion: "4.1.8"
8
+ topology: ["sharded"]
6
9
 
7
10
  database_name: &database_name "transaction-tests"
8
11
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -496,7 +499,7 @@ tests:
496
499
  mode: { times: 2 }
497
500
  data:
498
501
  failCommands: ["commitTransaction"]
499
- errorCode: 11602 # InterruptedDueToStepDown
502
+ errorCode: 11602 # InterruptedDueToReplStateChange
500
503
 
501
504
  operations:
502
505
  - name: startTransaction
@@ -0,0 +1,56 @@
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: []
13
+ tests:
14
+ - description: Client side error in command starting transaction
15
+
16
+ operations:
17
+ - name: startTransaction
18
+ object: session0
19
+ - name: insertOne
20
+ object: collection
21
+ arguments:
22
+ session: session0
23
+ document:
24
+ _id: {.: .}
25
+ error: true
26
+ - name: assertSessionTransactionState
27
+ object: testRunner
28
+ arguments:
29
+ session: session0
30
+ state: starting
31
+
32
+ - description: Client side error when transaction is in progress
33
+
34
+ operations:
35
+ - name: startTransaction
36
+ object: session0
37
+ - name: insertOne
38
+ object: collection
39
+ arguments:
40
+ session: session0
41
+ document:
42
+ _id: 4
43
+ result:
44
+ insertedId: 4
45
+ - name: insertOne
46
+ object: collection
47
+ arguments:
48
+ session: session0
49
+ document:
50
+ _id: {.: .}
51
+ error: true
52
+ - name: assertSessionTransactionState
53
+ object: testRunner
54
+ arguments:
55
+ session: session0
56
+ state: in_progress
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -2,6 +2,9 @@ runOn:
2
2
  -
3
3
  minServerVersion: "4.0"
4
4
  topology: ["replicaset"]
5
+ -
6
+ minServerVersion: "4.1.8"
7
+ topology: ["sharded"]
5
8
 
6
9
  database_name: &database_name "transaction-tests"
7
10
  collection_name: &collection_name "test"
@@ -4,6 +4,9 @@ runOn:
4
4
  -
5
5
  minServerVersion: "4.0"
6
6
  topology: ["replicaset"]
7
+ -
8
+ minServerVersion: "4.1.8"
9
+ topology: ["sharded"]
7
10
 
8
11
  database_name: &database_name "transaction-tests"
9
12
  collection_name: &collection_name "test"
@@ -0,0 +1,1671 @@
1
+ # Autogenerated tests that transient errors in a transaction unpin the session.
2
+ # See mongos-pin-auto-tests.py
3
+ runOn:
4
+ -
5
+ minServerVersion: "4.1.8"
6
+ topology: ["sharded"]
7
+
8
+ database_name: &database_name "transaction-tests"
9
+ collection_name: &collection_name "test"
10
+
11
+ data: &data
12
+ - {_id: 1}
13
+ - {_id: 2}
14
+
15
+ tests:
16
+ - description: remain pinned after non-transient Interrupted error on insertOne
17
+ useMultipleMongoses: true
18
+ operations:
19
+ - &startTransaction
20
+ name: startTransaction
21
+ object: session0
22
+ - &initialCommand
23
+ name: insertOne
24
+ object: collection
25
+ arguments:
26
+ session: session0
27
+ document: {_id: 3}
28
+ result:
29
+ insertedId: 3
30
+ - name: targetedFailPoint
31
+ object: testRunner
32
+ arguments:
33
+ session: session0
34
+ failPoint:
35
+ configureFailPoint: failCommand
36
+ mode: {times: 1}
37
+ data:
38
+ failCommands: ["insert"]
39
+ errorCode: 11601
40
+ - name: insertOne
41
+ object: collection
42
+ arguments:
43
+ session: session0
44
+ document:
45
+ _id: 4
46
+ result:
47
+ errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
48
+ errorCodeName: Interrupted
49
+ - &assertSessionPinned
50
+ name: assertSessionPinned
51
+ object: testRunner
52
+ arguments:
53
+ session: session0
54
+ - &commitTransaction
55
+ name: commitTransaction
56
+ object: session0
57
+
58
+ expectations:
59
+ - command_started_event:
60
+ command:
61
+ insert: *collection_name
62
+ documents:
63
+ - _id: 3
64
+ ordered: true
65
+ readConcern:
66
+ lsid: session0
67
+ txnNumber:
68
+ $numberLong: "1"
69
+ startTransaction: true
70
+ autocommit: false
71
+ writeConcern:
72
+ command_name: insert
73
+ database_name: *database_name
74
+ - command_started_event:
75
+ command:
76
+ insert: *collection_name
77
+ documents:
78
+ - _id: 4
79
+ ordered: true
80
+ readConcern:
81
+ lsid: session0
82
+ txnNumber:
83
+ $numberLong: "1"
84
+ startTransaction:
85
+ autocommit: false
86
+ writeConcern:
87
+ command_name: insert
88
+ database_name: *database_name
89
+ - command_started_event:
90
+ command:
91
+ commitTransaction: 1
92
+ lsid: session0
93
+ txnNumber:
94
+ $numberLong: "1"
95
+ startTransaction:
96
+ autocommit: false
97
+ writeConcern:
98
+ recoveryToken: 42
99
+ command_name: commitTransaction
100
+ database_name: admin
101
+
102
+ outcome: &outcome
103
+ collection:
104
+ data:
105
+ - {_id: 1}
106
+ - {_id: 2}
107
+ - {_id: 3}
108
+
109
+ - description: unpin after transient error within a transaction
110
+ useMultipleMongoses: true
111
+ operations:
112
+ - &startTransaction
113
+ name: startTransaction
114
+ object: session0
115
+ - &initialCommand
116
+ name: insertOne
117
+ object: collection
118
+ arguments:
119
+ session: session0
120
+ document:
121
+ _id: 3
122
+ result:
123
+ insertedId: 3
124
+ - name: targetedFailPoint
125
+ object: testRunner
126
+ arguments:
127
+ session: session0
128
+ failPoint:
129
+ configureFailPoint: failCommand
130
+ mode: { times: 1 }
131
+ data:
132
+ failCommands: ["insert"]
133
+ closeConnection: true
134
+ - name: insertOne
135
+ object: collection
136
+ arguments:
137
+ session: session0
138
+ document:
139
+ _id: 4
140
+ result:
141
+ errorLabelsContain: ["TransientTransactionError"]
142
+ errorLabelsOmit: ["UnknownTransactionCommitResult"]
143
+ # Session unpins from the first mongos after the insert error and
144
+ # abortTransaction succeeds immediately on any mongos.
145
+ - &assertSessionUnpinned
146
+ name: assertSessionUnpinned
147
+ object: testRunner
148
+ arguments:
149
+ session: session0
150
+ - &abortTransaction
151
+ name: abortTransaction
152
+ object: session0
153
+
154
+ expectations:
155
+ - command_started_event:
156
+ command:
157
+ insert: *collection_name
158
+ documents:
159
+ - _id: 3
160
+ ordered: true
161
+ readConcern:
162
+ lsid: session0
163
+ txnNumber:
164
+ $numberLong: "1"
165
+ startTransaction: true
166
+ autocommit: false
167
+ writeConcern:
168
+ command_name: insert
169
+ database_name: *database_name
170
+ - command_started_event:
171
+ command:
172
+ insert: *collection_name
173
+ documents:
174
+ - _id: 4
175
+ ordered: true
176
+ readConcern:
177
+ lsid: session0
178
+ txnNumber:
179
+ $numberLong: "1"
180
+ startTransaction:
181
+ autocommit: false
182
+ writeConcern:
183
+ command_name: insert
184
+ database_name: *database_name
185
+ - command_started_event:
186
+ command:
187
+ abortTransaction: 1
188
+ lsid: session0
189
+ txnNumber:
190
+ $numberLong: "1"
191
+ startTransaction:
192
+ autocommit: false
193
+ writeConcern:
194
+ recoveryToken: 42
195
+ command_name: abortTransaction
196
+ database_name: admin
197
+
198
+ outcome: &outcome
199
+ collection:
200
+ data: *data
201
+
202
+ # The rest of the tests in this file test every operation type against
203
+ # multiple types of transient errors (connection and error code).
204
+
205
+ - description: remain pinned after non-transient Interrupted error on insertOne insert
206
+ useMultipleMongoses: true
207
+ operations:
208
+ - *startTransaction
209
+ - *initialCommand
210
+ - name: targetedFailPoint
211
+ object: testRunner
212
+ arguments:
213
+ session: session0
214
+ failPoint:
215
+ configureFailPoint: failCommand
216
+ mode: {times: 1}
217
+ data:
218
+ failCommands: ["insert"]
219
+ errorCode: 11601
220
+ - name: insertOne
221
+ object: collection
222
+ arguments:
223
+ session: session0
224
+ document: {_id: 4}
225
+ result:
226
+ errorLabelsOmit: ["TransientTransactionError"]
227
+ - *assertSessionPinned
228
+ - *abortTransaction
229
+ outcome: *outcome
230
+
231
+ - description: remain pinned after non-transient Interrupted error on insertMany insert
232
+ useMultipleMongoses: true
233
+ operations:
234
+ - *startTransaction
235
+ - *initialCommand
236
+ - name: targetedFailPoint
237
+ object: testRunner
238
+ arguments:
239
+ session: session0
240
+ failPoint:
241
+ configureFailPoint: failCommand
242
+ mode: {times: 1}
243
+ data:
244
+ failCommands: ["insert"]
245
+ errorCode: 11601
246
+ - name: insertMany
247
+ object: collection
248
+ arguments:
249
+ session: session0
250
+ documents: [{_id: 4}, {_id: 5}]
251
+ result:
252
+ errorLabelsOmit: ["TransientTransactionError"]
253
+ - *assertSessionPinned
254
+ - *abortTransaction
255
+ outcome: *outcome
256
+
257
+ - description: remain pinned after non-transient Interrupted error on updateOne update
258
+ useMultipleMongoses: true
259
+ operations:
260
+ - *startTransaction
261
+ - *initialCommand
262
+ - name: targetedFailPoint
263
+ object: testRunner
264
+ arguments:
265
+ session: session0
266
+ failPoint:
267
+ configureFailPoint: failCommand
268
+ mode: {times: 1}
269
+ data:
270
+ failCommands: ["update"]
271
+ errorCode: 11601
272
+ - name: updateOne
273
+ object: collection
274
+ arguments:
275
+ session: session0
276
+ filter: {_id: 1}
277
+ update: {$inc: {x: 1}}
278
+ result:
279
+ errorLabelsOmit: ["TransientTransactionError"]
280
+ - *assertSessionPinned
281
+ - *abortTransaction
282
+ outcome: *outcome
283
+
284
+ - description: remain pinned after non-transient Interrupted error on replaceOne update
285
+ useMultipleMongoses: true
286
+ operations:
287
+ - *startTransaction
288
+ - *initialCommand
289
+ - name: targetedFailPoint
290
+ object: testRunner
291
+ arguments:
292
+ session: session0
293
+ failPoint:
294
+ configureFailPoint: failCommand
295
+ mode: {times: 1}
296
+ data:
297
+ failCommands: ["update"]
298
+ errorCode: 11601
299
+ - name: replaceOne
300
+ object: collection
301
+ arguments:
302
+ session: session0
303
+ filter: {_id: 1}
304
+ replacement: {y: 1}
305
+ result:
306
+ errorLabelsOmit: ["TransientTransactionError"]
307
+ - *assertSessionPinned
308
+ - *abortTransaction
309
+ outcome: *outcome
310
+
311
+ - description: remain pinned after non-transient Interrupted error on updateMany update
312
+ useMultipleMongoses: true
313
+ operations:
314
+ - *startTransaction
315
+ - *initialCommand
316
+ - name: targetedFailPoint
317
+ object: testRunner
318
+ arguments:
319
+ session: session0
320
+ failPoint:
321
+ configureFailPoint: failCommand
322
+ mode: {times: 1}
323
+ data:
324
+ failCommands: ["update"]
325
+ errorCode: 11601
326
+ - name: updateMany
327
+ object: collection
328
+ arguments:
329
+ session: session0
330
+ filter: {_id: {$gte: 1}}
331
+ update: {$set: {z: 1}}
332
+ result:
333
+ errorLabelsOmit: ["TransientTransactionError"]
334
+ - *assertSessionPinned
335
+ - *abortTransaction
336
+ outcome: *outcome
337
+
338
+ - description: remain pinned after non-transient Interrupted error on deleteOne delete
339
+ useMultipleMongoses: true
340
+ operations:
341
+ - *startTransaction
342
+ - *initialCommand
343
+ - name: targetedFailPoint
344
+ object: testRunner
345
+ arguments:
346
+ session: session0
347
+ failPoint:
348
+ configureFailPoint: failCommand
349
+ mode: {times: 1}
350
+ data:
351
+ failCommands: ["delete"]
352
+ errorCode: 11601
353
+ - name: deleteOne
354
+ object: collection
355
+ arguments:
356
+ session: session0
357
+ filter: {_id: 1}
358
+ result:
359
+ errorLabelsOmit: ["TransientTransactionError"]
360
+ - *assertSessionPinned
361
+ - *abortTransaction
362
+ outcome: *outcome
363
+
364
+ - description: remain pinned after non-transient Interrupted error on deleteMany delete
365
+ useMultipleMongoses: true
366
+ operations:
367
+ - *startTransaction
368
+ - *initialCommand
369
+ - name: targetedFailPoint
370
+ object: testRunner
371
+ arguments:
372
+ session: session0
373
+ failPoint:
374
+ configureFailPoint: failCommand
375
+ mode: {times: 1}
376
+ data:
377
+ failCommands: ["delete"]
378
+ errorCode: 11601
379
+ - name: deleteMany
380
+ object: collection
381
+ arguments:
382
+ session: session0
383
+ filter: {_id: {$gte: 1}}
384
+ result:
385
+ errorLabelsOmit: ["TransientTransactionError"]
386
+ - *assertSessionPinned
387
+ - *abortTransaction
388
+ outcome: *outcome
389
+
390
+ - description: remain pinned after non-transient Interrupted error on findOneAndDelete findAndModify
391
+ useMultipleMongoses: true
392
+ operations:
393
+ - *startTransaction
394
+ - *initialCommand
395
+ - name: targetedFailPoint
396
+ object: testRunner
397
+ arguments:
398
+ session: session0
399
+ failPoint:
400
+ configureFailPoint: failCommand
401
+ mode: {times: 1}
402
+ data:
403
+ failCommands: ["findAndModify"]
404
+ errorCode: 11601
405
+ - name: findOneAndDelete
406
+ object: collection
407
+ arguments:
408
+ session: session0
409
+ filter: {_id: 1}
410
+ result:
411
+ errorLabelsOmit: ["TransientTransactionError"]
412
+ - *assertSessionPinned
413
+ - *abortTransaction
414
+ outcome: *outcome
415
+
416
+ - description: remain pinned after non-transient Interrupted error on findOneAndUpdate findAndModify
417
+ useMultipleMongoses: true
418
+ operations:
419
+ - *startTransaction
420
+ - *initialCommand
421
+ - name: targetedFailPoint
422
+ object: testRunner
423
+ arguments:
424
+ session: session0
425
+ failPoint:
426
+ configureFailPoint: failCommand
427
+ mode: {times: 1}
428
+ data:
429
+ failCommands: ["findAndModify"]
430
+ errorCode: 11601
431
+ - name: findOneAndUpdate
432
+ object: collection
433
+ arguments:
434
+ session: session0
435
+ filter: {_id: 1}
436
+ update: {$inc: {x: 1}}
437
+ returnDocument: Before
438
+ result:
439
+ errorLabelsOmit: ["TransientTransactionError"]
440
+ - *assertSessionPinned
441
+ - *abortTransaction
442
+ outcome: *outcome
443
+
444
+ - description: remain pinned after non-transient Interrupted error on findOneAndReplace findAndModify
445
+ useMultipleMongoses: true
446
+ operations:
447
+ - *startTransaction
448
+ - *initialCommand
449
+ - name: targetedFailPoint
450
+ object: testRunner
451
+ arguments:
452
+ session: session0
453
+ failPoint:
454
+ configureFailPoint: failCommand
455
+ mode: {times: 1}
456
+ data:
457
+ failCommands: ["findAndModify"]
458
+ errorCode: 11601
459
+ - name: findOneAndReplace
460
+ object: collection
461
+ arguments:
462
+ session: session0
463
+ filter: {_id: 1}
464
+ replacement: {y: 1}
465
+ returnDocument: Before
466
+ result:
467
+ errorLabelsOmit: ["TransientTransactionError"]
468
+ - *assertSessionPinned
469
+ - *abortTransaction
470
+ outcome: *outcome
471
+
472
+ - description: remain pinned after non-transient Interrupted error on bulkWrite insert
473
+ useMultipleMongoses: true
474
+ operations:
475
+ - *startTransaction
476
+ - *initialCommand
477
+ - name: targetedFailPoint
478
+ object: testRunner
479
+ arguments:
480
+ session: session0
481
+ failPoint:
482
+ configureFailPoint: failCommand
483
+ mode: {times: 1}
484
+ data:
485
+ failCommands: ["insert"]
486
+ errorCode: 11601
487
+ - name: bulkWrite
488
+ object: collection
489
+ arguments:
490
+ session: session0
491
+ requests:
492
+ - name: insertOne
493
+ arguments:
494
+ document: {_id: 1}
495
+ result:
496
+ errorLabelsOmit: ["TransientTransactionError"]
497
+ - *assertSessionPinned
498
+ - *abortTransaction
499
+ outcome: *outcome
500
+
501
+ - description: remain pinned after non-transient Interrupted error on bulkWrite update
502
+ useMultipleMongoses: true
503
+ operations:
504
+ - *startTransaction
505
+ - *initialCommand
506
+ - name: targetedFailPoint
507
+ object: testRunner
508
+ arguments:
509
+ session: session0
510
+ failPoint:
511
+ configureFailPoint: failCommand
512
+ mode: {times: 1}
513
+ data:
514
+ failCommands: ["update"]
515
+ errorCode: 11601
516
+ - name: bulkWrite
517
+ object: collection
518
+ arguments:
519
+ session: session0
520
+ requests:
521
+ - name: updateOne
522
+ arguments:
523
+ filter: {_id: 1}
524
+ update: {$set: {x: 1}}
525
+ result:
526
+ errorLabelsOmit: ["TransientTransactionError"]
527
+ - *assertSessionPinned
528
+ - *abortTransaction
529
+ outcome: *outcome
530
+
531
+ - description: remain pinned after non-transient Interrupted error on bulkWrite delete
532
+ useMultipleMongoses: true
533
+ operations:
534
+ - *startTransaction
535
+ - *initialCommand
536
+ - name: targetedFailPoint
537
+ object: testRunner
538
+ arguments:
539
+ session: session0
540
+ failPoint:
541
+ configureFailPoint: failCommand
542
+ mode: {times: 1}
543
+ data:
544
+ failCommands: ["delete"]
545
+ errorCode: 11601
546
+ - name: bulkWrite
547
+ object: collection
548
+ arguments:
549
+ session: session0
550
+ requests:
551
+ - name: deleteOne
552
+ arguments:
553
+ filter: {_id: 1}
554
+ result:
555
+ errorLabelsOmit: ["TransientTransactionError"]
556
+ - *assertSessionPinned
557
+ - *abortTransaction
558
+ outcome: *outcome
559
+
560
+ - description: remain pinned after non-transient Interrupted error on find find
561
+ useMultipleMongoses: true
562
+ operations:
563
+ - *startTransaction
564
+ - *initialCommand
565
+ - name: targetedFailPoint
566
+ object: testRunner
567
+ arguments:
568
+ session: session0
569
+ failPoint:
570
+ configureFailPoint: failCommand
571
+ mode: {times: 1}
572
+ data:
573
+ failCommands: ["find"]
574
+ errorCode: 11601
575
+ - name: find
576
+ object: collection
577
+ arguments:
578
+ session: session0
579
+ filter: {_id: 1}
580
+ result:
581
+ errorLabelsOmit: ["TransientTransactionError"]
582
+ - *assertSessionPinned
583
+ - *abortTransaction
584
+ outcome: *outcome
585
+
586
+ - description: remain pinned after non-transient Interrupted error on countDocuments aggregate
587
+ useMultipleMongoses: true
588
+ operations:
589
+ - *startTransaction
590
+ - *initialCommand
591
+ - name: targetedFailPoint
592
+ object: testRunner
593
+ arguments:
594
+ session: session0
595
+ failPoint:
596
+ configureFailPoint: failCommand
597
+ mode: {times: 1}
598
+ data:
599
+ failCommands: ["aggregate"]
600
+ errorCode: 11601
601
+ - name: countDocuments
602
+ object: collection
603
+ arguments:
604
+ session: session0
605
+ filter: {}
606
+ result:
607
+ errorLabelsOmit: ["TransientTransactionError"]
608
+ - *assertSessionPinned
609
+ - *abortTransaction
610
+ outcome: *outcome
611
+
612
+ - description: remain pinned after non-transient Interrupted error on aggregate aggregate
613
+ useMultipleMongoses: true
614
+ operations:
615
+ - *startTransaction
616
+ - *initialCommand
617
+ - name: targetedFailPoint
618
+ object: testRunner
619
+ arguments:
620
+ session: session0
621
+ failPoint:
622
+ configureFailPoint: failCommand
623
+ mode: {times: 1}
624
+ data:
625
+ failCommands: ["aggregate"]
626
+ errorCode: 11601
627
+ - name: aggregate
628
+ object: collection
629
+ arguments:
630
+ session: session0
631
+ pipeline: []
632
+ result:
633
+ errorLabelsOmit: ["TransientTransactionError"]
634
+ - *assertSessionPinned
635
+ - *abortTransaction
636
+ outcome: *outcome
637
+
638
+ - description: remain pinned after non-transient Interrupted error on distinct distinct
639
+ useMultipleMongoses: true
640
+ operations:
641
+ - *startTransaction
642
+ - *initialCommand
643
+ - name: targetedFailPoint
644
+ object: testRunner
645
+ arguments:
646
+ session: session0
647
+ failPoint:
648
+ configureFailPoint: failCommand
649
+ mode: {times: 1}
650
+ data:
651
+ failCommands: ["distinct"]
652
+ errorCode: 11601
653
+ - name: distinct
654
+ object: collection
655
+ arguments:
656
+ session: session0
657
+ fieldName: _id
658
+ result:
659
+ errorLabelsOmit: ["TransientTransactionError"]
660
+ - *assertSessionPinned
661
+ - *abortTransaction
662
+ outcome: *outcome
663
+
664
+ - description: remain pinned after non-transient Interrupted error on runCommand insert
665
+ useMultipleMongoses: true
666
+ operations:
667
+ - *startTransaction
668
+ - *initialCommand
669
+ - name: targetedFailPoint
670
+ object: testRunner
671
+ arguments:
672
+ session: session0
673
+ failPoint:
674
+ configureFailPoint: failCommand
675
+ mode: {times: 1}
676
+ data:
677
+ failCommands: ["insert"]
678
+ errorCode: 11601
679
+ - name: runCommand
680
+ object: database
681
+ command_name: insert
682
+ arguments:
683
+ session: session0
684
+ command:
685
+ insert: *collection_name
686
+ documents:
687
+ - _id : 1
688
+ result:
689
+ errorLabelsOmit: ["TransientTransactionError"]
690
+ - *assertSessionPinned
691
+ - *abortTransaction
692
+ outcome: *outcome
693
+
694
+ - description: unpin after transient connection error on insertOne insert
695
+ useMultipleMongoses: true
696
+ operations:
697
+ - *startTransaction
698
+ - *initialCommand
699
+ - name: targetedFailPoint
700
+ object: testRunner
701
+ arguments:
702
+ session: session0
703
+ failPoint:
704
+ configureFailPoint: failCommand
705
+ mode: {times: 1}
706
+ data:
707
+ failCommands: ["insert"]
708
+ closeConnection: true
709
+ - name: insertOne
710
+ object: collection
711
+ arguments:
712
+ session: session0
713
+ document: {_id: 4}
714
+ result:
715
+ errorLabelsContain: ["TransientTransactionError"]
716
+ - *assertSessionUnpinned
717
+ - *abortTransaction
718
+ outcome: *outcome
719
+
720
+ - description: unpin after transient ShutdownInProgress error on insertOne insert
721
+ useMultipleMongoses: true
722
+ operations:
723
+ - *startTransaction
724
+ - *initialCommand
725
+ - name: targetedFailPoint
726
+ object: testRunner
727
+ arguments:
728
+ session: session0
729
+ failPoint:
730
+ configureFailPoint: failCommand
731
+ mode: {times: 1}
732
+ data:
733
+ failCommands: ["insert"]
734
+ errorCode: 91
735
+ - name: insertOne
736
+ object: collection
737
+ arguments:
738
+ session: session0
739
+ document: {_id: 4}
740
+ result:
741
+ errorLabelsContain: ["TransientTransactionError"]
742
+ - *assertSessionUnpinned
743
+ - *abortTransaction
744
+ outcome: *outcome
745
+
746
+ - description: unpin after transient connection error on insertMany insert
747
+ useMultipleMongoses: true
748
+ operations:
749
+ - *startTransaction
750
+ - *initialCommand
751
+ - name: targetedFailPoint
752
+ object: testRunner
753
+ arguments:
754
+ session: session0
755
+ failPoint:
756
+ configureFailPoint: failCommand
757
+ mode: {times: 1}
758
+ data:
759
+ failCommands: ["insert"]
760
+ closeConnection: true
761
+ - name: insertMany
762
+ object: collection
763
+ arguments:
764
+ session: session0
765
+ documents: [{_id: 4}, {_id: 5}]
766
+ result:
767
+ errorLabelsContain: ["TransientTransactionError"]
768
+ - *assertSessionUnpinned
769
+ - *abortTransaction
770
+ outcome: *outcome
771
+
772
+ - description: unpin after transient ShutdownInProgress error on insertMany insert
773
+ useMultipleMongoses: true
774
+ operations:
775
+ - *startTransaction
776
+ - *initialCommand
777
+ - name: targetedFailPoint
778
+ object: testRunner
779
+ arguments:
780
+ session: session0
781
+ failPoint:
782
+ configureFailPoint: failCommand
783
+ mode: {times: 1}
784
+ data:
785
+ failCommands: ["insert"]
786
+ errorCode: 91
787
+ - name: insertMany
788
+ object: collection
789
+ arguments:
790
+ session: session0
791
+ documents: [{_id: 4}, {_id: 5}]
792
+ result:
793
+ errorLabelsContain: ["TransientTransactionError"]
794
+ - *assertSessionUnpinned
795
+ - *abortTransaction
796
+ outcome: *outcome
797
+
798
+ - description: unpin after transient connection error on updateOne update
799
+ useMultipleMongoses: true
800
+ operations:
801
+ - *startTransaction
802
+ - *initialCommand
803
+ - name: targetedFailPoint
804
+ object: testRunner
805
+ arguments:
806
+ session: session0
807
+ failPoint:
808
+ configureFailPoint: failCommand
809
+ mode: {times: 1}
810
+ data:
811
+ failCommands: ["update"]
812
+ closeConnection: true
813
+ - name: updateOne
814
+ object: collection
815
+ arguments:
816
+ session: session0
817
+ filter: {_id: 1}
818
+ update: {$inc: {x: 1}}
819
+ result:
820
+ errorLabelsContain: ["TransientTransactionError"]
821
+ - *assertSessionUnpinned
822
+ - *abortTransaction
823
+ outcome: *outcome
824
+
825
+ - description: unpin after transient ShutdownInProgress error on updateOne update
826
+ useMultipleMongoses: true
827
+ operations:
828
+ - *startTransaction
829
+ - *initialCommand
830
+ - name: targetedFailPoint
831
+ object: testRunner
832
+ arguments:
833
+ session: session0
834
+ failPoint:
835
+ configureFailPoint: failCommand
836
+ mode: {times: 1}
837
+ data:
838
+ failCommands: ["update"]
839
+ errorCode: 91
840
+ - name: updateOne
841
+ object: collection
842
+ arguments:
843
+ session: session0
844
+ filter: {_id: 1}
845
+ update: {$inc: {x: 1}}
846
+ result:
847
+ errorLabelsContain: ["TransientTransactionError"]
848
+ - *assertSessionUnpinned
849
+ - *abortTransaction
850
+ outcome: *outcome
851
+
852
+ - description: unpin after transient connection error on replaceOne update
853
+ useMultipleMongoses: true
854
+ operations:
855
+ - *startTransaction
856
+ - *initialCommand
857
+ - name: targetedFailPoint
858
+ object: testRunner
859
+ arguments:
860
+ session: session0
861
+ failPoint:
862
+ configureFailPoint: failCommand
863
+ mode: {times: 1}
864
+ data:
865
+ failCommands: ["update"]
866
+ closeConnection: true
867
+ - name: replaceOne
868
+ object: collection
869
+ arguments:
870
+ session: session0
871
+ filter: {_id: 1}
872
+ replacement: {y: 1}
873
+ result:
874
+ errorLabelsContain: ["TransientTransactionError"]
875
+ - *assertSessionUnpinned
876
+ - *abortTransaction
877
+ outcome: *outcome
878
+
879
+ - description: unpin after transient ShutdownInProgress error on replaceOne update
880
+ useMultipleMongoses: true
881
+ operations:
882
+ - *startTransaction
883
+ - *initialCommand
884
+ - name: targetedFailPoint
885
+ object: testRunner
886
+ arguments:
887
+ session: session0
888
+ failPoint:
889
+ configureFailPoint: failCommand
890
+ mode: {times: 1}
891
+ data:
892
+ failCommands: ["update"]
893
+ errorCode: 91
894
+ - name: replaceOne
895
+ object: collection
896
+ arguments:
897
+ session: session0
898
+ filter: {_id: 1}
899
+ replacement: {y: 1}
900
+ result:
901
+ errorLabelsContain: ["TransientTransactionError"]
902
+ - *assertSessionUnpinned
903
+ - *abortTransaction
904
+ outcome: *outcome
905
+
906
+ - description: unpin after transient connection error on updateMany update
907
+ useMultipleMongoses: true
908
+ operations:
909
+ - *startTransaction
910
+ - *initialCommand
911
+ - name: targetedFailPoint
912
+ object: testRunner
913
+ arguments:
914
+ session: session0
915
+ failPoint:
916
+ configureFailPoint: failCommand
917
+ mode: {times: 1}
918
+ data:
919
+ failCommands: ["update"]
920
+ closeConnection: true
921
+ - name: updateMany
922
+ object: collection
923
+ arguments:
924
+ session: session0
925
+ filter: {_id: {$gte: 1}}
926
+ update: {$set: {z: 1}}
927
+ result:
928
+ errorLabelsContain: ["TransientTransactionError"]
929
+ - *assertSessionUnpinned
930
+ - *abortTransaction
931
+ outcome: *outcome
932
+
933
+ - description: unpin after transient ShutdownInProgress error on updateMany update
934
+ useMultipleMongoses: true
935
+ operations:
936
+ - *startTransaction
937
+ - *initialCommand
938
+ - name: targetedFailPoint
939
+ object: testRunner
940
+ arguments:
941
+ session: session0
942
+ failPoint:
943
+ configureFailPoint: failCommand
944
+ mode: {times: 1}
945
+ data:
946
+ failCommands: ["update"]
947
+ errorCode: 91
948
+ - name: updateMany
949
+ object: collection
950
+ arguments:
951
+ session: session0
952
+ filter: {_id: {$gte: 1}}
953
+ update: {$set: {z: 1}}
954
+ result:
955
+ errorLabelsContain: ["TransientTransactionError"]
956
+ - *assertSessionUnpinned
957
+ - *abortTransaction
958
+ outcome: *outcome
959
+
960
+ - description: unpin after transient connection error on deleteOne delete
961
+ useMultipleMongoses: true
962
+ operations:
963
+ - *startTransaction
964
+ - *initialCommand
965
+ - name: targetedFailPoint
966
+ object: testRunner
967
+ arguments:
968
+ session: session0
969
+ failPoint:
970
+ configureFailPoint: failCommand
971
+ mode: {times: 1}
972
+ data:
973
+ failCommands: ["delete"]
974
+ closeConnection: true
975
+ - name: deleteOne
976
+ object: collection
977
+ arguments:
978
+ session: session0
979
+ filter: {_id: 1}
980
+ result:
981
+ errorLabelsContain: ["TransientTransactionError"]
982
+ - *assertSessionUnpinned
983
+ - *abortTransaction
984
+ outcome: *outcome
985
+
986
+ - description: unpin after transient ShutdownInProgress error on deleteOne delete
987
+ useMultipleMongoses: true
988
+ operations:
989
+ - *startTransaction
990
+ - *initialCommand
991
+ - name: targetedFailPoint
992
+ object: testRunner
993
+ arguments:
994
+ session: session0
995
+ failPoint:
996
+ configureFailPoint: failCommand
997
+ mode: {times: 1}
998
+ data:
999
+ failCommands: ["delete"]
1000
+ errorCode: 91
1001
+ - name: deleteOne
1002
+ object: collection
1003
+ arguments:
1004
+ session: session0
1005
+ filter: {_id: 1}
1006
+ result:
1007
+ errorLabelsContain: ["TransientTransactionError"]
1008
+ - *assertSessionUnpinned
1009
+ - *abortTransaction
1010
+ outcome: *outcome
1011
+
1012
+ - description: unpin after transient connection error on deleteMany delete
1013
+ useMultipleMongoses: true
1014
+ operations:
1015
+ - *startTransaction
1016
+ - *initialCommand
1017
+ - name: targetedFailPoint
1018
+ object: testRunner
1019
+ arguments:
1020
+ session: session0
1021
+ failPoint:
1022
+ configureFailPoint: failCommand
1023
+ mode: {times: 1}
1024
+ data:
1025
+ failCommands: ["delete"]
1026
+ closeConnection: true
1027
+ - name: deleteMany
1028
+ object: collection
1029
+ arguments:
1030
+ session: session0
1031
+ filter: {_id: {$gte: 1}}
1032
+ result:
1033
+ errorLabelsContain: ["TransientTransactionError"]
1034
+ - *assertSessionUnpinned
1035
+ - *abortTransaction
1036
+ outcome: *outcome
1037
+
1038
+ - description: unpin after transient ShutdownInProgress error on deleteMany delete
1039
+ useMultipleMongoses: true
1040
+ operations:
1041
+ - *startTransaction
1042
+ - *initialCommand
1043
+ - name: targetedFailPoint
1044
+ object: testRunner
1045
+ arguments:
1046
+ session: session0
1047
+ failPoint:
1048
+ configureFailPoint: failCommand
1049
+ mode: {times: 1}
1050
+ data:
1051
+ failCommands: ["delete"]
1052
+ errorCode: 91
1053
+ - name: deleteMany
1054
+ object: collection
1055
+ arguments:
1056
+ session: session0
1057
+ filter: {_id: {$gte: 1}}
1058
+ result:
1059
+ errorLabelsContain: ["TransientTransactionError"]
1060
+ - *assertSessionUnpinned
1061
+ - *abortTransaction
1062
+ outcome: *outcome
1063
+
1064
+ - description: unpin after transient connection error on findOneAndDelete findAndModify
1065
+ useMultipleMongoses: true
1066
+ operations:
1067
+ - *startTransaction
1068
+ - *initialCommand
1069
+ - name: targetedFailPoint
1070
+ object: testRunner
1071
+ arguments:
1072
+ session: session0
1073
+ failPoint:
1074
+ configureFailPoint: failCommand
1075
+ mode: {times: 1}
1076
+ data:
1077
+ failCommands: ["findAndModify"]
1078
+ closeConnection: true
1079
+ - name: findOneAndDelete
1080
+ object: collection
1081
+ arguments:
1082
+ session: session0
1083
+ filter: {_id: 1}
1084
+ result:
1085
+ errorLabelsContain: ["TransientTransactionError"]
1086
+ - *assertSessionUnpinned
1087
+ - *abortTransaction
1088
+ outcome: *outcome
1089
+
1090
+ - description: unpin after transient ShutdownInProgress error on findOneAndDelete findAndModify
1091
+ useMultipleMongoses: true
1092
+ operations:
1093
+ - *startTransaction
1094
+ - *initialCommand
1095
+ - name: targetedFailPoint
1096
+ object: testRunner
1097
+ arguments:
1098
+ session: session0
1099
+ failPoint:
1100
+ configureFailPoint: failCommand
1101
+ mode: {times: 1}
1102
+ data:
1103
+ failCommands: ["findAndModify"]
1104
+ errorCode: 91
1105
+ - name: findOneAndDelete
1106
+ object: collection
1107
+ arguments:
1108
+ session: session0
1109
+ filter: {_id: 1}
1110
+ result:
1111
+ errorLabelsContain: ["TransientTransactionError"]
1112
+ - *assertSessionUnpinned
1113
+ - *abortTransaction
1114
+ outcome: *outcome
1115
+
1116
+ - description: unpin after transient connection error on findOneAndUpdate findAndModify
1117
+ useMultipleMongoses: true
1118
+ operations:
1119
+ - *startTransaction
1120
+ - *initialCommand
1121
+ - name: targetedFailPoint
1122
+ object: testRunner
1123
+ arguments:
1124
+ session: session0
1125
+ failPoint:
1126
+ configureFailPoint: failCommand
1127
+ mode: {times: 1}
1128
+ data:
1129
+ failCommands: ["findAndModify"]
1130
+ closeConnection: true
1131
+ - name: findOneAndUpdate
1132
+ object: collection
1133
+ arguments:
1134
+ session: session0
1135
+ filter: {_id: 1}
1136
+ update: {$inc: {x: 1}}
1137
+ returnDocument: Before
1138
+ result:
1139
+ errorLabelsContain: ["TransientTransactionError"]
1140
+ - *assertSessionUnpinned
1141
+ - *abortTransaction
1142
+ outcome: *outcome
1143
+
1144
+ - description: unpin after transient ShutdownInProgress error on findOneAndUpdate findAndModify
1145
+ useMultipleMongoses: true
1146
+ operations:
1147
+ - *startTransaction
1148
+ - *initialCommand
1149
+ - name: targetedFailPoint
1150
+ object: testRunner
1151
+ arguments:
1152
+ session: session0
1153
+ failPoint:
1154
+ configureFailPoint: failCommand
1155
+ mode: {times: 1}
1156
+ data:
1157
+ failCommands: ["findAndModify"]
1158
+ errorCode: 91
1159
+ - name: findOneAndUpdate
1160
+ object: collection
1161
+ arguments:
1162
+ session: session0
1163
+ filter: {_id: 1}
1164
+ update: {$inc: {x: 1}}
1165
+ returnDocument: Before
1166
+ result:
1167
+ errorLabelsContain: ["TransientTransactionError"]
1168
+ - *assertSessionUnpinned
1169
+ - *abortTransaction
1170
+ outcome: *outcome
1171
+
1172
+ - description: unpin after transient connection error on findOneAndReplace findAndModify
1173
+ useMultipleMongoses: true
1174
+ operations:
1175
+ - *startTransaction
1176
+ - *initialCommand
1177
+ - name: targetedFailPoint
1178
+ object: testRunner
1179
+ arguments:
1180
+ session: session0
1181
+ failPoint:
1182
+ configureFailPoint: failCommand
1183
+ mode: {times: 1}
1184
+ data:
1185
+ failCommands: ["findAndModify"]
1186
+ closeConnection: true
1187
+ - name: findOneAndReplace
1188
+ object: collection
1189
+ arguments:
1190
+ session: session0
1191
+ filter: {_id: 1}
1192
+ replacement: {y: 1}
1193
+ returnDocument: Before
1194
+ result:
1195
+ errorLabelsContain: ["TransientTransactionError"]
1196
+ - *assertSessionUnpinned
1197
+ - *abortTransaction
1198
+ outcome: *outcome
1199
+
1200
+ - description: unpin after transient ShutdownInProgress error on findOneAndReplace findAndModify
1201
+ useMultipleMongoses: true
1202
+ operations:
1203
+ - *startTransaction
1204
+ - *initialCommand
1205
+ - name: targetedFailPoint
1206
+ object: testRunner
1207
+ arguments:
1208
+ session: session0
1209
+ failPoint:
1210
+ configureFailPoint: failCommand
1211
+ mode: {times: 1}
1212
+ data:
1213
+ failCommands: ["findAndModify"]
1214
+ errorCode: 91
1215
+ - name: findOneAndReplace
1216
+ object: collection
1217
+ arguments:
1218
+ session: session0
1219
+ filter: {_id: 1}
1220
+ replacement: {y: 1}
1221
+ returnDocument: Before
1222
+ result:
1223
+ errorLabelsContain: ["TransientTransactionError"]
1224
+ - *assertSessionUnpinned
1225
+ - *abortTransaction
1226
+ outcome: *outcome
1227
+
1228
+ - description: unpin after transient connection error on bulkWrite insert
1229
+ useMultipleMongoses: true
1230
+ operations:
1231
+ - *startTransaction
1232
+ - *initialCommand
1233
+ - name: targetedFailPoint
1234
+ object: testRunner
1235
+ arguments:
1236
+ session: session0
1237
+ failPoint:
1238
+ configureFailPoint: failCommand
1239
+ mode: {times: 1}
1240
+ data:
1241
+ failCommands: ["insert"]
1242
+ closeConnection: true
1243
+ - name: bulkWrite
1244
+ object: collection
1245
+ arguments:
1246
+ session: session0
1247
+ requests:
1248
+ - name: insertOne
1249
+ arguments:
1250
+ document: {_id: 1}
1251
+ result:
1252
+ errorLabelsContain: ["TransientTransactionError"]
1253
+ - *assertSessionUnpinned
1254
+ - *abortTransaction
1255
+ outcome: *outcome
1256
+
1257
+ - description: unpin after transient ShutdownInProgress error on bulkWrite insert
1258
+ useMultipleMongoses: true
1259
+ operations:
1260
+ - *startTransaction
1261
+ - *initialCommand
1262
+ - name: targetedFailPoint
1263
+ object: testRunner
1264
+ arguments:
1265
+ session: session0
1266
+ failPoint:
1267
+ configureFailPoint: failCommand
1268
+ mode: {times: 1}
1269
+ data:
1270
+ failCommands: ["insert"]
1271
+ errorCode: 91
1272
+ - name: bulkWrite
1273
+ object: collection
1274
+ arguments:
1275
+ session: session0
1276
+ requests:
1277
+ - name: insertOne
1278
+ arguments:
1279
+ document: {_id: 1}
1280
+ result:
1281
+ errorLabelsContain: ["TransientTransactionError"]
1282
+ - *assertSessionUnpinned
1283
+ - *abortTransaction
1284
+ outcome: *outcome
1285
+
1286
+ - description: unpin after transient connection error on bulkWrite update
1287
+ useMultipleMongoses: true
1288
+ operations:
1289
+ - *startTransaction
1290
+ - *initialCommand
1291
+ - name: targetedFailPoint
1292
+ object: testRunner
1293
+ arguments:
1294
+ session: session0
1295
+ failPoint:
1296
+ configureFailPoint: failCommand
1297
+ mode: {times: 1}
1298
+ data:
1299
+ failCommands: ["update"]
1300
+ closeConnection: true
1301
+ - name: bulkWrite
1302
+ object: collection
1303
+ arguments:
1304
+ session: session0
1305
+ requests:
1306
+ - name: updateOne
1307
+ arguments:
1308
+ filter: {_id: 1}
1309
+ update: {$set: {x: 1}}
1310
+ result:
1311
+ errorLabelsContain: ["TransientTransactionError"]
1312
+ - *assertSessionUnpinned
1313
+ - *abortTransaction
1314
+ outcome: *outcome
1315
+
1316
+ - description: unpin after transient ShutdownInProgress error on bulkWrite update
1317
+ useMultipleMongoses: true
1318
+ operations:
1319
+ - *startTransaction
1320
+ - *initialCommand
1321
+ - name: targetedFailPoint
1322
+ object: testRunner
1323
+ arguments:
1324
+ session: session0
1325
+ failPoint:
1326
+ configureFailPoint: failCommand
1327
+ mode: {times: 1}
1328
+ data:
1329
+ failCommands: ["update"]
1330
+ errorCode: 91
1331
+ - name: bulkWrite
1332
+ object: collection
1333
+ arguments:
1334
+ session: session0
1335
+ requests:
1336
+ - name: updateOne
1337
+ arguments:
1338
+ filter: {_id: 1}
1339
+ update: {$set: {x: 1}}
1340
+ result:
1341
+ errorLabelsContain: ["TransientTransactionError"]
1342
+ - *assertSessionUnpinned
1343
+ - *abortTransaction
1344
+ outcome: *outcome
1345
+
1346
+ - description: unpin after transient connection error on bulkWrite delete
1347
+ useMultipleMongoses: true
1348
+ operations:
1349
+ - *startTransaction
1350
+ - *initialCommand
1351
+ - name: targetedFailPoint
1352
+ object: testRunner
1353
+ arguments:
1354
+ session: session0
1355
+ failPoint:
1356
+ configureFailPoint: failCommand
1357
+ mode: {times: 1}
1358
+ data:
1359
+ failCommands: ["delete"]
1360
+ closeConnection: true
1361
+ - name: bulkWrite
1362
+ object: collection
1363
+ arguments:
1364
+ session: session0
1365
+ requests:
1366
+ - name: deleteOne
1367
+ arguments:
1368
+ filter: {_id: 1}
1369
+ result:
1370
+ errorLabelsContain: ["TransientTransactionError"]
1371
+ - *assertSessionUnpinned
1372
+ - *abortTransaction
1373
+ outcome: *outcome
1374
+
1375
+ - description: unpin after transient ShutdownInProgress error on bulkWrite delete
1376
+ useMultipleMongoses: true
1377
+ operations:
1378
+ - *startTransaction
1379
+ - *initialCommand
1380
+ - name: targetedFailPoint
1381
+ object: testRunner
1382
+ arguments:
1383
+ session: session0
1384
+ failPoint:
1385
+ configureFailPoint: failCommand
1386
+ mode: {times: 1}
1387
+ data:
1388
+ failCommands: ["delete"]
1389
+ errorCode: 91
1390
+ - name: bulkWrite
1391
+ object: collection
1392
+ arguments:
1393
+ session: session0
1394
+ requests:
1395
+ - name: deleteOne
1396
+ arguments:
1397
+ filter: {_id: 1}
1398
+ result:
1399
+ errorLabelsContain: ["TransientTransactionError"]
1400
+ - *assertSessionUnpinned
1401
+ - *abortTransaction
1402
+ outcome: *outcome
1403
+
1404
+ - description: unpin after transient connection error on find find
1405
+ useMultipleMongoses: true
1406
+ operations:
1407
+ - *startTransaction
1408
+ - *initialCommand
1409
+ - name: targetedFailPoint
1410
+ object: testRunner
1411
+ arguments:
1412
+ session: session0
1413
+ failPoint:
1414
+ configureFailPoint: failCommand
1415
+ mode: {times: 1}
1416
+ data:
1417
+ failCommands: ["find"]
1418
+ closeConnection: true
1419
+ - name: find
1420
+ object: collection
1421
+ arguments:
1422
+ session: session0
1423
+ filter: {_id: 1}
1424
+ result:
1425
+ errorLabelsContain: ["TransientTransactionError"]
1426
+ - *assertSessionUnpinned
1427
+ - *abortTransaction
1428
+ outcome: *outcome
1429
+
1430
+ - description: unpin after transient ShutdownInProgress error on find find
1431
+ useMultipleMongoses: true
1432
+ operations:
1433
+ - *startTransaction
1434
+ - *initialCommand
1435
+ - name: targetedFailPoint
1436
+ object: testRunner
1437
+ arguments:
1438
+ session: session0
1439
+ failPoint:
1440
+ configureFailPoint: failCommand
1441
+ mode: {times: 1}
1442
+ data:
1443
+ failCommands: ["find"]
1444
+ errorCode: 91
1445
+ - name: find
1446
+ object: collection
1447
+ arguments:
1448
+ session: session0
1449
+ filter: {_id: 1}
1450
+ result:
1451
+ errorLabelsContain: ["TransientTransactionError"]
1452
+ - *assertSessionUnpinned
1453
+ - *abortTransaction
1454
+ outcome: *outcome
1455
+
1456
+ - description: unpin after transient connection error on countDocuments aggregate
1457
+ useMultipleMongoses: true
1458
+ operations:
1459
+ - *startTransaction
1460
+ - *initialCommand
1461
+ - name: targetedFailPoint
1462
+ object: testRunner
1463
+ arguments:
1464
+ session: session0
1465
+ failPoint:
1466
+ configureFailPoint: failCommand
1467
+ mode: {times: 1}
1468
+ data:
1469
+ failCommands: ["aggregate"]
1470
+ closeConnection: true
1471
+ - name: countDocuments
1472
+ object: collection
1473
+ arguments:
1474
+ session: session0
1475
+ filter: {}
1476
+ result:
1477
+ errorLabelsContain: ["TransientTransactionError"]
1478
+ - *assertSessionUnpinned
1479
+ - *abortTransaction
1480
+ outcome: *outcome
1481
+
1482
+ - description: unpin after transient ShutdownInProgress error on countDocuments aggregate
1483
+ useMultipleMongoses: true
1484
+ operations:
1485
+ - *startTransaction
1486
+ - *initialCommand
1487
+ - name: targetedFailPoint
1488
+ object: testRunner
1489
+ arguments:
1490
+ session: session0
1491
+ failPoint:
1492
+ configureFailPoint: failCommand
1493
+ mode: {times: 1}
1494
+ data:
1495
+ failCommands: ["aggregate"]
1496
+ errorCode: 91
1497
+ - name: countDocuments
1498
+ object: collection
1499
+ arguments:
1500
+ session: session0
1501
+ filter: {}
1502
+ result:
1503
+ errorLabelsContain: ["TransientTransactionError"]
1504
+ - *assertSessionUnpinned
1505
+ - *abortTransaction
1506
+ outcome: *outcome
1507
+
1508
+ - description: unpin after transient connection error on aggregate aggregate
1509
+ useMultipleMongoses: true
1510
+ operations:
1511
+ - *startTransaction
1512
+ - *initialCommand
1513
+ - name: targetedFailPoint
1514
+ object: testRunner
1515
+ arguments:
1516
+ session: session0
1517
+ failPoint:
1518
+ configureFailPoint: failCommand
1519
+ mode: {times: 1}
1520
+ data:
1521
+ failCommands: ["aggregate"]
1522
+ closeConnection: true
1523
+ - name: aggregate
1524
+ object: collection
1525
+ arguments:
1526
+ session: session0
1527
+ pipeline: []
1528
+ result:
1529
+ errorLabelsContain: ["TransientTransactionError"]
1530
+ - *assertSessionUnpinned
1531
+ - *abortTransaction
1532
+ outcome: *outcome
1533
+
1534
+ - description: unpin after transient ShutdownInProgress error on aggregate aggregate
1535
+ useMultipleMongoses: true
1536
+ operations:
1537
+ - *startTransaction
1538
+ - *initialCommand
1539
+ - name: targetedFailPoint
1540
+ object: testRunner
1541
+ arguments:
1542
+ session: session0
1543
+ failPoint:
1544
+ configureFailPoint: failCommand
1545
+ mode: {times: 1}
1546
+ data:
1547
+ failCommands: ["aggregate"]
1548
+ errorCode: 91
1549
+ - name: aggregate
1550
+ object: collection
1551
+ arguments:
1552
+ session: session0
1553
+ pipeline: []
1554
+ result:
1555
+ errorLabelsContain: ["TransientTransactionError"]
1556
+ - *assertSessionUnpinned
1557
+ - *abortTransaction
1558
+ outcome: *outcome
1559
+
1560
+ - description: unpin after transient connection error on distinct distinct
1561
+ useMultipleMongoses: true
1562
+ operations:
1563
+ - *startTransaction
1564
+ - *initialCommand
1565
+ - name: targetedFailPoint
1566
+ object: testRunner
1567
+ arguments:
1568
+ session: session0
1569
+ failPoint:
1570
+ configureFailPoint: failCommand
1571
+ mode: {times: 1}
1572
+ data:
1573
+ failCommands: ["distinct"]
1574
+ closeConnection: true
1575
+ - name: distinct
1576
+ object: collection
1577
+ arguments:
1578
+ session: session0
1579
+ fieldName: _id
1580
+ result:
1581
+ errorLabelsContain: ["TransientTransactionError"]
1582
+ - *assertSessionUnpinned
1583
+ - *abortTransaction
1584
+ outcome: *outcome
1585
+
1586
+ - description: unpin after transient ShutdownInProgress error on distinct distinct
1587
+ useMultipleMongoses: true
1588
+ operations:
1589
+ - *startTransaction
1590
+ - *initialCommand
1591
+ - name: targetedFailPoint
1592
+ object: testRunner
1593
+ arguments:
1594
+ session: session0
1595
+ failPoint:
1596
+ configureFailPoint: failCommand
1597
+ mode: {times: 1}
1598
+ data:
1599
+ failCommands: ["distinct"]
1600
+ errorCode: 91
1601
+ - name: distinct
1602
+ object: collection
1603
+ arguments:
1604
+ session: session0
1605
+ fieldName: _id
1606
+ result:
1607
+ errorLabelsContain: ["TransientTransactionError"]
1608
+ - *assertSessionUnpinned
1609
+ - *abortTransaction
1610
+ outcome: *outcome
1611
+
1612
+ - description: unpin after transient connection error on runCommand insert
1613
+ useMultipleMongoses: true
1614
+ operations:
1615
+ - *startTransaction
1616
+ - *initialCommand
1617
+ - name: targetedFailPoint
1618
+ object: testRunner
1619
+ arguments:
1620
+ session: session0
1621
+ failPoint:
1622
+ configureFailPoint: failCommand
1623
+ mode: {times: 1}
1624
+ data:
1625
+ failCommands: ["insert"]
1626
+ closeConnection: true
1627
+ - name: runCommand
1628
+ object: database
1629
+ command_name: insert
1630
+ arguments:
1631
+ session: session0
1632
+ command:
1633
+ insert: *collection_name
1634
+ documents:
1635
+ - _id : 1
1636
+ result:
1637
+ errorLabelsContain: ["TransientTransactionError"]
1638
+ - *assertSessionUnpinned
1639
+ - *abortTransaction
1640
+ outcome: *outcome
1641
+
1642
+ - description: unpin after transient ShutdownInProgress error on runCommand insert
1643
+ useMultipleMongoses: true
1644
+ operations:
1645
+ - *startTransaction
1646
+ - *initialCommand
1647
+ - name: targetedFailPoint
1648
+ object: testRunner
1649
+ arguments:
1650
+ session: session0
1651
+ failPoint:
1652
+ configureFailPoint: failCommand
1653
+ mode: {times: 1}
1654
+ data:
1655
+ failCommands: ["insert"]
1656
+ errorCode: 91
1657
+ - name: runCommand
1658
+ object: database
1659
+ command_name: insert
1660
+ arguments:
1661
+ session: session0
1662
+ command:
1663
+ insert: *collection_name
1664
+ documents:
1665
+ - _id : 1
1666
+ result:
1667
+ errorLabelsContain: ["TransientTransactionError"]
1668
+ - *assertSessionUnpinned
1669
+ - *abortTransaction
1670
+ outcome: *outcome
1671
+