mongo 2.20.1 → 2.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/Rakefile +2 -2
  4. data/lib/mongo/address.rb +22 -3
  5. data/lib/mongo/auth/aws/credentials_retriever.rb +70 -17
  6. data/lib/mongo/auth/base.rb +1 -1
  7. data/lib/mongo/bulk_write.rb +35 -2
  8. data/lib/mongo/client.rb +38 -6
  9. data/lib/mongo/client_encryption.rb +6 -3
  10. data/lib/mongo/cluster/reapers/cursor_reaper.rb +6 -1
  11. data/lib/mongo/cluster/sdam_flow.rb +20 -7
  12. data/lib/mongo/cluster.rb +14 -4
  13. data/lib/mongo/collection/helpers.rb +1 -1
  14. data/lib/mongo/collection/view/aggregation/behavior.rb +131 -0
  15. data/lib/mongo/collection/view/aggregation.rb +33 -99
  16. data/lib/mongo/collection/view/builder/aggregation.rb +1 -7
  17. data/lib/mongo/collection/view/change_stream.rb +80 -27
  18. data/lib/mongo/collection/view/iterable.rb +76 -60
  19. data/lib/mongo/collection/view/map_reduce.rb +25 -8
  20. data/lib/mongo/collection/view/readable.rb +79 -30
  21. data/lib/mongo/collection/view/writable.rb +109 -48
  22. data/lib/mongo/collection/view.rb +43 -3
  23. data/lib/mongo/collection.rb +158 -23
  24. data/lib/mongo/crypt/auto_encrypter.rb +4 -6
  25. data/lib/mongo/crypt/binding.rb +4 -4
  26. data/lib/mongo/crypt/context.rb +20 -14
  27. data/lib/mongo/crypt/encryption_io.rb +56 -26
  28. data/lib/mongo/crypt/explicit_encrypter.rb +49 -20
  29. data/lib/mongo/crypt/explicit_encryption_context.rb +17 -11
  30. data/lib/mongo/crypt/kms/azure/credentials_retriever.rb +22 -6
  31. data/lib/mongo/crypt/kms/gcp/credentials_retriever.rb +29 -4
  32. data/lib/mongo/csot_timeout_holder.rb +119 -0
  33. data/lib/mongo/cursor/kill_spec.rb +5 -2
  34. data/lib/mongo/cursor/nontailable.rb +27 -0
  35. data/lib/mongo/cursor.rb +86 -24
  36. data/lib/mongo/cursor_host.rb +82 -0
  37. data/lib/mongo/database/view.rb +81 -14
  38. data/lib/mongo/database.rb +88 -18
  39. data/lib/mongo/error/operation_failure.rb +209 -204
  40. data/lib/mongo/error/server_timeout_error.rb +12 -0
  41. data/lib/mongo/error/socket_timeout_error.rb +3 -1
  42. data/lib/mongo/error/timeout_error.rb +23 -0
  43. data/lib/mongo/error.rb +2 -0
  44. data/lib/mongo/grid/fs_bucket.rb +45 -12
  45. data/lib/mongo/grid/stream/read.rb +15 -1
  46. data/lib/mongo/grid/stream/write.rb +21 -4
  47. data/lib/mongo/index/view.rb +77 -16
  48. data/lib/mongo/operation/context.rb +40 -2
  49. data/lib/mongo/operation/create_search_indexes/op_msg.rb +2 -2
  50. data/lib/mongo/operation/delete/op_msg.rb +2 -1
  51. data/lib/mongo/operation/drop_search_index/op_msg.rb +2 -2
  52. data/lib/mongo/operation/find/op_msg.rb +45 -0
  53. data/lib/mongo/operation/get_more/op_msg.rb +33 -0
  54. data/lib/mongo/operation/insert/op_msg.rb +3 -2
  55. data/lib/mongo/operation/insert/result.rb +4 -2
  56. data/lib/mongo/operation/list_collections/result.rb +1 -1
  57. data/lib/mongo/operation/map_reduce/result.rb +1 -1
  58. data/lib/mongo/operation/op_msg_base.rb +3 -1
  59. data/lib/mongo/operation/result.rb +26 -5
  60. data/lib/mongo/operation/shared/executable.rb +12 -1
  61. data/lib/mongo/operation/shared/op_msg_executable.rb +4 -1
  62. data/lib/mongo/operation/shared/response_handling.rb +3 -3
  63. data/lib/mongo/operation/shared/sessions_supported.rb +1 -1
  64. data/lib/mongo/operation/shared/timed.rb +52 -0
  65. data/lib/mongo/operation/shared/write.rb +4 -1
  66. data/lib/mongo/operation/update/op_msg.rb +2 -1
  67. data/lib/mongo/operation/update_search_index/op_msg.rb +2 -2
  68. data/lib/mongo/operation.rb +1 -0
  69. data/lib/mongo/protocol/message.rb +1 -4
  70. data/lib/mongo/protocol/msg.rb +2 -2
  71. data/lib/mongo/retryable/read_worker.rb +69 -29
  72. data/lib/mongo/retryable/write_worker.rb +49 -18
  73. data/lib/mongo/retryable.rb +8 -2
  74. data/lib/mongo/server/connection.rb +11 -5
  75. data/lib/mongo/server/connection_base.rb +22 -2
  76. data/lib/mongo/server/connection_pool.rb +32 -14
  77. data/lib/mongo/server/description/features.rb +1 -1
  78. data/lib/mongo/server/description.rb +18 -5
  79. data/lib/mongo/server/monitor.rb +7 -4
  80. data/lib/mongo/server/pending_connection.rb +7 -3
  81. data/lib/mongo/server/{round_trip_time_averager.rb → round_trip_time_calculator.rb} +25 -7
  82. data/lib/mongo/server.rb +11 -6
  83. data/lib/mongo/server_selector/base.rb +25 -9
  84. data/lib/mongo/session.rb +78 -9
  85. data/lib/mongo/socket/ssl.rb +109 -17
  86. data/lib/mongo/socket/tcp.rb +40 -6
  87. data/lib/mongo/socket.rb +154 -25
  88. data/lib/mongo/uri/options_mapper.rb +1 -0
  89. data/lib/mongo/version.rb +1 -1
  90. data/lib/mongo.rb +1 -0
  91. data/spec/atlas/atlas_connectivity_spec.rb +4 -0
  92. data/spec/atlas/operations_spec.rb +4 -0
  93. data/spec/integration/client_side_encryption/auto_encryption_mongocryptd_spawn_spec.rb +2 -1
  94. data/spec/integration/client_side_encryption/auto_encryption_spec.rb +494 -487
  95. data/spec/integration/client_side_encryption/on_demand_aws_credentials_spec.rb +1 -1
  96. data/spec/integration/client_side_encryption/range_explicit_encryption_prose_spec.rb +66 -22
  97. data/spec/integration/client_side_operations_timeout/encryption_prose_spec.rb +131 -0
  98. data/spec/integration/connection_pool_populator_spec.rb +2 -0
  99. data/spec/integration/cursor_pinning_spec.rb +15 -60
  100. data/spec/integration/cursor_reaping_spec.rb +1 -1
  101. data/spec/integration/docs_examples_spec.rb +1 -1
  102. data/spec/integration/operation_failure_code_spec.rb +1 -1
  103. data/spec/integration/operation_failure_message_spec.rb +3 -3
  104. data/spec/integration/retryable_errors_spec.rb +2 -2
  105. data/spec/integration/sdam_error_handling_spec.rb +2 -1
  106. data/spec/integration/search_indexes_prose_spec.rb +4 -0
  107. data/spec/integration/server_spec.rb +4 -3
  108. data/spec/integration/transactions_api_examples_spec.rb +2 -0
  109. data/spec/kerberos/kerberos_spec.rb +4 -0
  110. data/spec/lite_spec_helper.rb +3 -1
  111. data/spec/mongo/auth/user/view_spec.rb +1 -1
  112. data/spec/mongo/caching_cursor_spec.rb +1 -1
  113. data/spec/mongo/client_encryption_spec.rb +1 -0
  114. data/spec/mongo/client_spec.rb +158 -4
  115. data/spec/mongo/collection/view/aggregation_spec.rb +14 -39
  116. data/spec/mongo/collection/view/change_stream_spec.rb +3 -3
  117. data/spec/mongo/collection_spec.rb +5 -6
  118. data/spec/mongo/crypt/auto_encrypter_spec.rb +14 -12
  119. data/spec/mongo/crypt/data_key_context_spec.rb +3 -1
  120. data/spec/mongo/crypt/explicit_encryption_context_spec.rb +2 -2
  121. data/spec/mongo/crypt/handle_spec.rb +1 -1
  122. data/spec/mongo/cursor_spec.rb +26 -9
  123. data/spec/mongo/error/operation_failure_heavy_spec.rb +2 -2
  124. data/spec/mongo/operation/context_spec.rb +79 -0
  125. data/spec/mongo/operation/create/op_msg_spec.rb +106 -110
  126. data/spec/mongo/operation/delete/op_msg_spec.rb +6 -5
  127. data/spec/mongo/operation/find/op_msg_spec.rb +66 -0
  128. data/spec/mongo/operation/get_more/op_msg_spec.rb +65 -0
  129. data/spec/mongo/operation/insert/op_msg_spec.rb +128 -131
  130. data/spec/mongo/operation/shared/csot/examples.rb +113 -0
  131. data/spec/mongo/query_cache_spec.rb +243 -225
  132. data/spec/mongo/retryable_spec.rb +1 -0
  133. data/spec/mongo/server/round_trip_time_calculator_spec.rb +120 -0
  134. data/spec/mongo/socket/ssl_spec.rb +0 -10
  135. data/spec/runners/change_streams/test.rb +2 -2
  136. data/spec/runners/crud/operation.rb +1 -1
  137. data/spec/runners/crud/verifier.rb +3 -1
  138. data/spec/runners/transactions/operation.rb +4 -6
  139. data/spec/runners/unified/ambiguous_operations.rb +13 -0
  140. data/spec/runners/unified/assertions.rb +4 -0
  141. data/spec/runners/unified/change_stream_operations.rb +14 -24
  142. data/spec/runners/unified/crud_operations.rb +82 -59
  143. data/spec/runners/unified/ddl_operations.rb +38 -7
  144. data/spec/runners/unified/grid_fs_operations.rb +37 -2
  145. data/spec/runners/unified/support_operations.rb +43 -4
  146. data/spec/runners/unified/test.rb +22 -10
  147. data/spec/runners/unified.rb +1 -1
  148. data/spec/solo/clean_exit_spec.rb +2 -0
  149. data/spec/spec_tests/client_side_operations_timeout_spec.rb +15 -0
  150. data/spec/spec_tests/data/change_streams_unified/change-streams-clusterTime.yml +3 -1
  151. data/spec/spec_tests/data/change_streams_unified/change-streams-disambiguatedPaths.yml +3 -1
  152. data/spec/spec_tests/data/change_streams_unified/change-streams-errors.yml +3 -1
  153. data/spec/spec_tests/data/change_streams_unified/change-streams-pre_and_post_images.yml +1 -1
  154. data/spec/spec_tests/data/change_streams_unified/change-streams-resume-allowlist.yml +1 -1
  155. data/spec/spec_tests/data/change_streams_unified/change-streams-resume-errorLabels.yml +1 -1
  156. data/spec/spec_tests/data/change_streams_unified/change-streams-showExpandedEvents.yml +1 -1
  157. data/spec/spec_tests/data/client_side_encryption/badQueries.yml +2 -1
  158. data/spec/spec_tests/data/client_side_encryption/timeoutMS.yml +67 -0
  159. data/spec/spec_tests/data/client_side_operations_timeout/bulkWrite.yml +87 -0
  160. data/spec/spec_tests/data/client_side_operations_timeout/change-streams.yml +358 -0
  161. data/spec/spec_tests/data/client_side_operations_timeout/close-cursors.yml +129 -0
  162. data/spec/spec_tests/data/client_side_operations_timeout/command-execution.yml +250 -0
  163. data/spec/spec_tests/data/client_side_operations_timeout/convenient-transactions.yml +113 -0
  164. data/spec/spec_tests/data/client_side_operations_timeout/cursors.yml +70 -0
  165. data/spec/spec_tests/data/client_side_operations_timeout/deprecated-options.yml +3982 -0
  166. data/spec/spec_tests/data/client_side_operations_timeout/error-transformations.yml +96 -0
  167. data/spec/spec_tests/data/client_side_operations_timeout/global-timeoutMS.yml +3236 -0
  168. data/spec/spec_tests/data/client_side_operations_timeout/gridfs-advanced.yml +207 -0
  169. data/spec/spec_tests/data/client_side_operations_timeout/gridfs-delete.yml +152 -0
  170. data/spec/spec_tests/data/client_side_operations_timeout/gridfs-download.yml +182 -0
  171. data/spec/spec_tests/data/client_side_operations_timeout/gridfs-find.yml +100 -0
  172. data/spec/spec_tests/data/client_side_operations_timeout/gridfs-upload.yml +249 -0
  173. data/spec/spec_tests/data/client_side_operations_timeout/legacy-timeouts.yml +204 -0
  174. data/spec/spec_tests/data/client_side_operations_timeout/non-tailable-cursors.yml +307 -0
  175. data/spec/spec_tests/data/client_side_operations_timeout/override-collection-timeoutMS.yml +1877 -0
  176. data/spec/spec_tests/data/client_side_operations_timeout/override-operation-timeoutMS.yml +1918 -0
  177. data/spec/spec_tests/data/client_side_operations_timeout/retryability-legacy-timeouts.yml +1676 -0
  178. data/spec/spec_tests/data/client_side_operations_timeout/retryability-timeoutMS.yml +2824 -0
  179. data/spec/spec_tests/data/client_side_operations_timeout/sessions-inherit-timeoutMS.yml +168 -0
  180. data/spec/spec_tests/data/client_side_operations_timeout/sessions-override-operation-timeoutMS.yml +171 -0
  181. data/spec/spec_tests/data/client_side_operations_timeout/sessions-override-timeoutMS.yml +168 -0
  182. data/spec/spec_tests/data/client_side_operations_timeout/tailable-awaitData.yml +247 -0
  183. data/spec/spec_tests/data/client_side_operations_timeout/tailable-non-awaitData.yml +181 -0
  184. data/spec/spec_tests/data/crud_unified/aggregate-write-readPreference.yml +4 -0
  185. data/spec/spec_tests/data/crud_unified/db-aggregate-write-readPreference.yml +4 -0
  186. data/spec/spec_tests/data/crud_unified/find-test-all-options.yml +29 -0
  187. data/spec/spec_tests/server_selection_rtt_spec.rb +6 -6
  188. data/spec/support/certificates/atlas-ocsp-ca.crt +81 -83
  189. data/spec/support/certificates/atlas-ocsp.crt +107 -107
  190. data/spec/support/cluster_tools.rb +3 -3
  191. data/spec/support/common_shortcuts.rb +2 -2
  192. data/spec/support/crypt/encrypted_fields/range-encryptedFields-Date.json +1 -1
  193. data/spec/support/crypt/encrypted_fields/range-encryptedFields-DecimalNoPrecision.json +1 -1
  194. data/spec/support/crypt/encrypted_fields/range-encryptedFields-DecimalPrecision.json +1 -1
  195. data/spec/support/crypt/encrypted_fields/range-encryptedFields-DoubleNoPrecision.json +1 -1
  196. data/spec/support/crypt/encrypted_fields/range-encryptedFields-DoublePrecision.json +1 -1
  197. data/spec/support/crypt/encrypted_fields/range-encryptedFields-Int.json +1 -1
  198. data/spec/support/crypt/encrypted_fields/range-encryptedFields-Long.json +1 -1
  199. data/spec/support/shared/session.rb +2 -2
  200. data/spec/support/spec_setup.rb +2 -2
  201. data/spec/support/utils.rb +3 -1
  202. metadata +78 -91
  203. data/spec/mongo/server/round_trip_time_averager_spec.rb +0 -48
  204. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Date-Aggregate.yml +0 -242
  205. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Date-Correctness.yml +0 -423
  206. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Date-Delete.yml +0 -183
  207. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Date-FindOneAndUpdate.yml +0 -240
  208. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Date-InsertFind.yml +0 -236
  209. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Date-Update.yml +0 -253
  210. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Decimal-Aggregate.yml +0 -1688
  211. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Decimal-Correctness.yml +0 -294
  212. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Decimal-Delete.yml +0 -906
  213. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Decimal-FindOneAndUpdate.yml +0 -1685
  214. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Decimal-InsertFind.yml +0 -1681
  215. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Decimal-Update.yml +0 -1698
  216. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DecimalPrecision-Aggregate.yml +0 -330
  217. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DecimalPrecision-Correctness.yml +0 -425
  218. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DecimalPrecision-Delete.yml +0 -227
  219. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DecimalPrecision-FindOneAndUpdate.yml +0 -328
  220. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DecimalPrecision-InsertFind.yml +0 -320
  221. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DecimalPrecision-Update.yml +0 -337
  222. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Double-Aggregate.yml +0 -914
  223. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Double-Correctness.yml +0 -293
  224. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Double-Delete.yml +0 -519
  225. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Double-FindOneAndUpdate.yml +0 -912
  226. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Double-InsertFind.yml +0 -908
  227. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Double-Update.yml +0 -925
  228. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DoublePrecision-Aggregate.yml +0 -326
  229. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DoublePrecision-Correctness.yml +0 -425
  230. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DoublePrecision-Delete.yml +0 -225
  231. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DoublePrecision-FindOneAndUpdate.yml +0 -324
  232. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DoublePrecision-InsertFind.yml +0 -320
  233. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-DoublePrecision-Update.yml +0 -339
  234. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Int-Aggregate.yml +0 -242
  235. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Int-Correctness.yml +0 -424
  236. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Int-Delete.yml +0 -183
  237. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Int-FindOneAndUpdate.yml +0 -240
  238. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Int-InsertFind.yml +0 -236
  239. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Int-Update.yml +0 -255
  240. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Long-Aggregate.yml +0 -242
  241. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Long-Correctness.yml +0 -423
  242. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Long-Delete.yml +0 -183
  243. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Long-FindOneAndUpdate.yml +0 -240
  244. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Long-InsertFind.yml +0 -236
  245. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-Long-Update.yml +0 -255
  246. data/spec/spec_tests/data/client_side_encryption/fle2v2-Range-WrongType.yml +0 -44
@@ -0,0 +1,2824 @@
1
+ # Tests in this file are generated from retryability-timeoutMS.yml.template.
2
+
3
+ description: "timeoutMS behaves correctly for retryable operations"
4
+
5
+ schemaVersion: "1.9"
6
+
7
+ # failCommand is available on 4.0+ replica sets and 4.2+ sharded clusters.
8
+ runOnRequirements:
9
+ - minServerVersion: "4.0"
10
+ topologies: ["replicaset"]
11
+ - minServerVersion: "4.2"
12
+ topologies: ["sharded"]
13
+
14
+ createEntities:
15
+ - client:
16
+ id: &failPointClient failPointClient
17
+ useMultipleMongoses: false
18
+ - client:
19
+ id: &client client
20
+ uriOptions:
21
+ timeoutMS: 100
22
+ useMultipleMongoses: false
23
+ observeEvents:
24
+ - commandStartedEvent
25
+ ignoreCommandMonitoringEvents:
26
+ - killCursors
27
+ - database:
28
+ id: &database database
29
+ client: *client
30
+ databaseName: &databaseName test
31
+ - collection:
32
+ id: &collection collection
33
+ database: *database
34
+ collectionName: &collectionName coll
35
+
36
+ initialData:
37
+ - collectionName: *collectionName
38
+ databaseName: *databaseName
39
+ documents: []
40
+
41
+ tests:
42
+ # For each retryable operation, run three tests:
43
+ #
44
+ # 1. timeoutMS applies to the whole operation, not to individual attempts - Client timeoutMS=100 and the operation is
45
+ # fails with a retryable error after being blocked server-side for 60ms. The operation should fail with a timeout error
46
+ # because the second attempt should take it over the 100ms limit. This test only runs on 4.4+ because it uses the
47
+ # blockConnection option in failCommand.
48
+ #
49
+ # 2. operation is retried multiple times if timeoutMS is set to a non-zero value - Client timeoutMS=100 and the
50
+ # operation fails with a retryable error twice. Drivers should send the original operation and two retries, the
51
+ # second of which should succeed.
52
+ #
53
+ # 3. operation is retried multiple times if timeoutMS is set to a zero - Override timeoutMS to zero for the operation
54
+ # and set a fail point to force a retryable error twice. Drivers should send the original operation and two retries,
55
+ # the second of which should succeed.
56
+ #
57
+ # The fail points in these tests use error code 7 (HostNotFound) because it is a retryable error but does not trigger
58
+ # an SDAM state change so we don't lose any time to server rediscovery. The tests also explicitly specify an
59
+ # errorLabels array in the fail point to avoid behavioral differences among server types and ensure that the error
60
+ # will be considered retryable.
61
+
62
+ - description: "timeoutMS applies to whole operation, not individual attempts - insertOne on collection"
63
+ runOnRequirements:
64
+ - minServerVersion: "4.4"
65
+ operations:
66
+ - name: failPoint
67
+ object: testRunner
68
+ arguments:
69
+ client: *failPointClient
70
+ failPoint:
71
+ configureFailPoint: failCommand
72
+ mode: { times: 4 }
73
+ data:
74
+ failCommands: ["insert"]
75
+ blockConnection: true
76
+ blockTimeMS: 60
77
+ errorCode: 7
78
+ errorLabels: ["RetryableWriteError"]
79
+ - name: insertOne
80
+ object: *collection
81
+ arguments:
82
+ document: { x: 1 }
83
+
84
+ expectError:
85
+ isTimeoutError: true
86
+ - description: "operation is retried multiple times for non-zero timeoutMS - insertOne on collection"
87
+ runOnRequirements:
88
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
89
+ operations:
90
+ - name: failPoint
91
+ object: testRunner
92
+ arguments:
93
+ client: *failPointClient
94
+ failPoint:
95
+ configureFailPoint: failCommand
96
+ mode: { times: 2 }
97
+ data:
98
+ failCommands: ["insert"]
99
+ errorCode: 7
100
+ closeConnection: false
101
+ errorLabels: ["RetryableWriteError"]
102
+ - name: insertOne
103
+ object: *collection
104
+ arguments:
105
+ timeoutMS: 1000
106
+ document: { x: 1 }
107
+
108
+ expectEvents:
109
+ - client: *client
110
+ events:
111
+ - commandStartedEvent:
112
+ commandName: insert
113
+ databaseName: *databaseName
114
+ command:
115
+ insert: *collectionName
116
+ maxTimeMS: { $$type: ["int", "long"] }
117
+ - commandStartedEvent:
118
+ commandName: insert
119
+ databaseName: *databaseName
120
+ command:
121
+ insert: *collectionName
122
+ maxTimeMS: { $$type: ["int", "long"] }
123
+ - commandStartedEvent:
124
+ commandName: insert
125
+ databaseName: *databaseName
126
+ command:
127
+ insert: *collectionName
128
+ maxTimeMS: { $$type: ["int", "long"] }
129
+ - description: "operation is retried multiple times if timeoutMS is zero - insertOne on collection"
130
+ runOnRequirements:
131
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
132
+ operations:
133
+ - name: failPoint
134
+ object: testRunner
135
+ arguments:
136
+ client: *failPointClient
137
+ failPoint:
138
+ configureFailPoint: failCommand
139
+ mode: { times: 2 }
140
+ data:
141
+ failCommands: ["insert"]
142
+ errorCode: 7
143
+ closeConnection: false
144
+ errorLabels: ["RetryableWriteError"]
145
+ - name: insertOne
146
+ object: *collection
147
+ arguments:
148
+ timeoutMS: 0
149
+ document: { x: 1 }
150
+
151
+ expectEvents:
152
+ - client: *client
153
+ events:
154
+ - commandStartedEvent:
155
+ commandName: insert
156
+ databaseName: *databaseName
157
+ command:
158
+ insert: *collectionName
159
+ maxTimeMS: { $$exists: false }
160
+ - commandStartedEvent:
161
+ commandName: insert
162
+ databaseName: *databaseName
163
+ command:
164
+ insert: *collectionName
165
+ maxTimeMS: { $$exists: false }
166
+ - commandStartedEvent:
167
+ commandName: insert
168
+ databaseName: *databaseName
169
+ command:
170
+ insert: *collectionName
171
+ maxTimeMS: { $$exists: false }
172
+ - description: "timeoutMS applies to whole operation, not individual attempts - insertMany on collection"
173
+ runOnRequirements:
174
+ - minServerVersion: "4.4"
175
+ operations:
176
+ - name: failPoint
177
+ object: testRunner
178
+ arguments:
179
+ client: *failPointClient
180
+ failPoint:
181
+ configureFailPoint: failCommand
182
+ mode: { times: 4 }
183
+ data:
184
+ failCommands: ["insert"]
185
+ blockConnection: true
186
+ blockTimeMS: 60
187
+ errorCode: 7
188
+ errorLabels: ["RetryableWriteError"]
189
+ - name: insertMany
190
+ object: *collection
191
+ arguments:
192
+ documents:
193
+ - { x: 1 }
194
+
195
+ expectError:
196
+ isTimeoutError: true
197
+ - description: "operation is retried multiple times for non-zero timeoutMS - insertMany on collection"
198
+ runOnRequirements:
199
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
200
+ operations:
201
+ - name: failPoint
202
+ object: testRunner
203
+ arguments:
204
+ client: *failPointClient
205
+ failPoint:
206
+ configureFailPoint: failCommand
207
+ mode: { times: 2 }
208
+ data:
209
+ failCommands: ["insert"]
210
+ errorCode: 7
211
+ closeConnection: false
212
+ errorLabels: ["RetryableWriteError"]
213
+ - name: insertMany
214
+ object: *collection
215
+ arguments:
216
+ timeoutMS: 1000
217
+ documents:
218
+ - { x: 1 }
219
+
220
+ expectEvents:
221
+ - client: *client
222
+ events:
223
+ - commandStartedEvent:
224
+ commandName: insert
225
+ databaseName: *databaseName
226
+ command:
227
+ insert: *collectionName
228
+ maxTimeMS: { $$type: ["int", "long"] }
229
+ - commandStartedEvent:
230
+ commandName: insert
231
+ databaseName: *databaseName
232
+ command:
233
+ insert: *collectionName
234
+ maxTimeMS: { $$type: ["int", "long"] }
235
+ - commandStartedEvent:
236
+ commandName: insert
237
+ databaseName: *databaseName
238
+ command:
239
+ insert: *collectionName
240
+ maxTimeMS: { $$type: ["int", "long"] }
241
+ - description: "operation is retried multiple times if timeoutMS is zero - insertMany on collection"
242
+ runOnRequirements:
243
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
244
+ operations:
245
+ - name: failPoint
246
+ object: testRunner
247
+ arguments:
248
+ client: *failPointClient
249
+ failPoint:
250
+ configureFailPoint: failCommand
251
+ mode: { times: 2 }
252
+ data:
253
+ failCommands: ["insert"]
254
+ errorCode: 7
255
+ closeConnection: false
256
+ errorLabels: ["RetryableWriteError"]
257
+ - name: insertMany
258
+ object: *collection
259
+ arguments:
260
+ timeoutMS: 0
261
+ documents:
262
+ - { x: 1 }
263
+
264
+ expectEvents:
265
+ - client: *client
266
+ events:
267
+ - commandStartedEvent:
268
+ commandName: insert
269
+ databaseName: *databaseName
270
+ command:
271
+ insert: *collectionName
272
+ maxTimeMS: { $$exists: false }
273
+ - commandStartedEvent:
274
+ commandName: insert
275
+ databaseName: *databaseName
276
+ command:
277
+ insert: *collectionName
278
+ maxTimeMS: { $$exists: false }
279
+ - commandStartedEvent:
280
+ commandName: insert
281
+ databaseName: *databaseName
282
+ command:
283
+ insert: *collectionName
284
+ maxTimeMS: { $$exists: false }
285
+ - description: "timeoutMS applies to whole operation, not individual attempts - deleteOne on collection"
286
+ runOnRequirements:
287
+ - minServerVersion: "4.4"
288
+ operations:
289
+ - name: failPoint
290
+ object: testRunner
291
+ arguments:
292
+ client: *failPointClient
293
+ failPoint:
294
+ configureFailPoint: failCommand
295
+ mode: { times: 4 }
296
+ data:
297
+ failCommands: ["delete"]
298
+ blockConnection: true
299
+ blockTimeMS: 60
300
+ errorCode: 7
301
+ errorLabels: ["RetryableWriteError"]
302
+ - name: deleteOne
303
+ object: *collection
304
+ arguments:
305
+ filter: {}
306
+
307
+ expectError:
308
+ isTimeoutError: true
309
+ - description: "operation is retried multiple times for non-zero timeoutMS - deleteOne on collection"
310
+ runOnRequirements:
311
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
312
+ operations:
313
+ - name: failPoint
314
+ object: testRunner
315
+ arguments:
316
+ client: *failPointClient
317
+ failPoint:
318
+ configureFailPoint: failCommand
319
+ mode: { times: 2 }
320
+ data:
321
+ failCommands: ["delete"]
322
+ errorCode: 7
323
+ closeConnection: false
324
+ errorLabels: ["RetryableWriteError"]
325
+ - name: deleteOne
326
+ object: *collection
327
+ arguments:
328
+ timeoutMS: 1000
329
+ filter: {}
330
+
331
+ expectEvents:
332
+ - client: *client
333
+ events:
334
+ - commandStartedEvent:
335
+ commandName: delete
336
+ databaseName: *databaseName
337
+ command:
338
+ delete: *collectionName
339
+ maxTimeMS: { $$type: ["int", "long"] }
340
+ - commandStartedEvent:
341
+ commandName: delete
342
+ databaseName: *databaseName
343
+ command:
344
+ delete: *collectionName
345
+ maxTimeMS: { $$type: ["int", "long"] }
346
+ - commandStartedEvent:
347
+ commandName: delete
348
+ databaseName: *databaseName
349
+ command:
350
+ delete: *collectionName
351
+ maxTimeMS: { $$type: ["int", "long"] }
352
+ - description: "operation is retried multiple times if timeoutMS is zero - deleteOne on collection"
353
+ runOnRequirements:
354
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
355
+ operations:
356
+ - name: failPoint
357
+ object: testRunner
358
+ arguments:
359
+ client: *failPointClient
360
+ failPoint:
361
+ configureFailPoint: failCommand
362
+ mode: { times: 2 }
363
+ data:
364
+ failCommands: ["delete"]
365
+ errorCode: 7
366
+ closeConnection: false
367
+ errorLabels: ["RetryableWriteError"]
368
+ - name: deleteOne
369
+ object: *collection
370
+ arguments:
371
+ timeoutMS: 0
372
+ filter: {}
373
+
374
+ expectEvents:
375
+ - client: *client
376
+ events:
377
+ - commandStartedEvent:
378
+ commandName: delete
379
+ databaseName: *databaseName
380
+ command:
381
+ delete: *collectionName
382
+ maxTimeMS: { $$exists: false }
383
+ - commandStartedEvent:
384
+ commandName: delete
385
+ databaseName: *databaseName
386
+ command:
387
+ delete: *collectionName
388
+ maxTimeMS: { $$exists: false }
389
+ - commandStartedEvent:
390
+ commandName: delete
391
+ databaseName: *databaseName
392
+ command:
393
+ delete: *collectionName
394
+ maxTimeMS: { $$exists: false }
395
+ - description: "timeoutMS applies to whole operation, not individual attempts - replaceOne on collection"
396
+ runOnRequirements:
397
+ - minServerVersion: "4.4"
398
+ operations:
399
+ - name: failPoint
400
+ object: testRunner
401
+ arguments:
402
+ client: *failPointClient
403
+ failPoint:
404
+ configureFailPoint: failCommand
405
+ mode: { times: 4 }
406
+ data:
407
+ failCommands: ["update"]
408
+ blockConnection: true
409
+ blockTimeMS: 60
410
+ errorCode: 7
411
+ errorLabels: ["RetryableWriteError"]
412
+ - name: replaceOne
413
+ object: *collection
414
+ arguments:
415
+ filter: {}
416
+ replacement: { x: 1 }
417
+
418
+ expectError:
419
+ isTimeoutError: true
420
+ - description: "operation is retried multiple times for non-zero timeoutMS - replaceOne on collection"
421
+ runOnRequirements:
422
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
423
+ operations:
424
+ - name: failPoint
425
+ object: testRunner
426
+ arguments:
427
+ client: *failPointClient
428
+ failPoint:
429
+ configureFailPoint: failCommand
430
+ mode: { times: 2 }
431
+ data:
432
+ failCommands: ["update"]
433
+ errorCode: 7
434
+ closeConnection: false
435
+ errorLabels: ["RetryableWriteError"]
436
+ - name: replaceOne
437
+ object: *collection
438
+ arguments:
439
+ timeoutMS: 1000
440
+ filter: {}
441
+ replacement: { x: 1 }
442
+
443
+ expectEvents:
444
+ - client: *client
445
+ events:
446
+ - commandStartedEvent:
447
+ commandName: update
448
+ databaseName: *databaseName
449
+ command:
450
+ update: *collectionName
451
+ maxTimeMS: { $$type: ["int", "long"] }
452
+ - commandStartedEvent:
453
+ commandName: update
454
+ databaseName: *databaseName
455
+ command:
456
+ update: *collectionName
457
+ maxTimeMS: { $$type: ["int", "long"] }
458
+ - commandStartedEvent:
459
+ commandName: update
460
+ databaseName: *databaseName
461
+ command:
462
+ update: *collectionName
463
+ maxTimeMS: { $$type: ["int", "long"] }
464
+ - description: "operation is retried multiple times if timeoutMS is zero - replaceOne on collection"
465
+ runOnRequirements:
466
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
467
+ operations:
468
+ - name: failPoint
469
+ object: testRunner
470
+ arguments:
471
+ client: *failPointClient
472
+ failPoint:
473
+ configureFailPoint: failCommand
474
+ mode: { times: 2 }
475
+ data:
476
+ failCommands: ["update"]
477
+ errorCode: 7
478
+ closeConnection: false
479
+ errorLabels: ["RetryableWriteError"]
480
+ - name: replaceOne
481
+ object: *collection
482
+ arguments:
483
+ timeoutMS: 0
484
+ filter: {}
485
+ replacement: { x: 1 }
486
+
487
+ expectEvents:
488
+ - client: *client
489
+ events:
490
+ - commandStartedEvent:
491
+ commandName: update
492
+ databaseName: *databaseName
493
+ command:
494
+ update: *collectionName
495
+ maxTimeMS: { $$exists: false }
496
+ - commandStartedEvent:
497
+ commandName: update
498
+ databaseName: *databaseName
499
+ command:
500
+ update: *collectionName
501
+ maxTimeMS: { $$exists: false }
502
+ - commandStartedEvent:
503
+ commandName: update
504
+ databaseName: *databaseName
505
+ command:
506
+ update: *collectionName
507
+ maxTimeMS: { $$exists: false }
508
+ - description: "timeoutMS applies to whole operation, not individual attempts - updateOne on collection"
509
+ runOnRequirements:
510
+ - minServerVersion: "4.4"
511
+ operations:
512
+ - name: failPoint
513
+ object: testRunner
514
+ arguments:
515
+ client: *failPointClient
516
+ failPoint:
517
+ configureFailPoint: failCommand
518
+ mode: { times: 4 }
519
+ data:
520
+ failCommands: ["update"]
521
+ blockConnection: true
522
+ blockTimeMS: 60
523
+ errorCode: 7
524
+ errorLabels: ["RetryableWriteError"]
525
+ - name: updateOne
526
+ object: *collection
527
+ arguments:
528
+ filter: {}
529
+ update: { $set: { x: 1 } }
530
+
531
+ expectError:
532
+ isTimeoutError: true
533
+ - description: "operation is retried multiple times for non-zero timeoutMS - updateOne on collection"
534
+ runOnRequirements:
535
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
536
+ operations:
537
+ - name: failPoint
538
+ object: testRunner
539
+ arguments:
540
+ client: *failPointClient
541
+ failPoint:
542
+ configureFailPoint: failCommand
543
+ mode: { times: 2 }
544
+ data:
545
+ failCommands: ["update"]
546
+ errorCode: 7
547
+ closeConnection: false
548
+ errorLabels: ["RetryableWriteError"]
549
+ - name: updateOne
550
+ object: *collection
551
+ arguments:
552
+ timeoutMS: 1000
553
+ filter: {}
554
+ update: { $set: { x: 1 } }
555
+
556
+ expectEvents:
557
+ - client: *client
558
+ events:
559
+ - commandStartedEvent:
560
+ commandName: update
561
+ databaseName: *databaseName
562
+ command:
563
+ update: *collectionName
564
+ maxTimeMS: { $$type: ["int", "long"] }
565
+ - commandStartedEvent:
566
+ commandName: update
567
+ databaseName: *databaseName
568
+ command:
569
+ update: *collectionName
570
+ maxTimeMS: { $$type: ["int", "long"] }
571
+ - commandStartedEvent:
572
+ commandName: update
573
+ databaseName: *databaseName
574
+ command:
575
+ update: *collectionName
576
+ maxTimeMS: { $$type: ["int", "long"] }
577
+ - description: "operation is retried multiple times if timeoutMS is zero - updateOne on collection"
578
+ runOnRequirements:
579
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
580
+ operations:
581
+ - name: failPoint
582
+ object: testRunner
583
+ arguments:
584
+ client: *failPointClient
585
+ failPoint:
586
+ configureFailPoint: failCommand
587
+ mode: { times: 2 }
588
+ data:
589
+ failCommands: ["update"]
590
+ errorCode: 7
591
+ closeConnection: false
592
+ errorLabels: ["RetryableWriteError"]
593
+ - name: updateOne
594
+ object: *collection
595
+ arguments:
596
+ timeoutMS: 0
597
+ filter: {}
598
+ update: { $set: { x: 1 } }
599
+
600
+ expectEvents:
601
+ - client: *client
602
+ events:
603
+ - commandStartedEvent:
604
+ commandName: update
605
+ databaseName: *databaseName
606
+ command:
607
+ update: *collectionName
608
+ maxTimeMS: { $$exists: false }
609
+ - commandStartedEvent:
610
+ commandName: update
611
+ databaseName: *databaseName
612
+ command:
613
+ update: *collectionName
614
+ maxTimeMS: { $$exists: false }
615
+ - commandStartedEvent:
616
+ commandName: update
617
+ databaseName: *databaseName
618
+ command:
619
+ update: *collectionName
620
+ maxTimeMS: { $$exists: false }
621
+ - description: "timeoutMS applies to whole operation, not individual attempts - findOneAndDelete on collection"
622
+ runOnRequirements:
623
+ - minServerVersion: "4.4"
624
+ operations:
625
+ - name: failPoint
626
+ object: testRunner
627
+ arguments:
628
+ client: *failPointClient
629
+ failPoint:
630
+ configureFailPoint: failCommand
631
+ mode: { times: 4 }
632
+ data:
633
+ failCommands: ["findAndModify"]
634
+ blockConnection: true
635
+ blockTimeMS: 60
636
+ errorCode: 7
637
+ errorLabels: ["RetryableWriteError"]
638
+ - name: findOneAndDelete
639
+ object: *collection
640
+ arguments:
641
+ filter: {}
642
+
643
+ expectError:
644
+ isTimeoutError: true
645
+ - description: "operation is retried multiple times for non-zero timeoutMS - findOneAndDelete on collection"
646
+ runOnRequirements:
647
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
648
+ operations:
649
+ - name: failPoint
650
+ object: testRunner
651
+ arguments:
652
+ client: *failPointClient
653
+ failPoint:
654
+ configureFailPoint: failCommand
655
+ mode: { times: 2 }
656
+ data:
657
+ failCommands: ["findAndModify"]
658
+ errorCode: 7
659
+ closeConnection: false
660
+ errorLabels: ["RetryableWriteError"]
661
+ - name: findOneAndDelete
662
+ object: *collection
663
+ arguments:
664
+ timeoutMS: 1000
665
+ filter: {}
666
+
667
+ expectEvents:
668
+ - client: *client
669
+ events:
670
+ - commandStartedEvent:
671
+ commandName: findAndModify
672
+ databaseName: *databaseName
673
+ command:
674
+ findAndModify: *collectionName
675
+ maxTimeMS: { $$type: ["int", "long"] }
676
+ - commandStartedEvent:
677
+ commandName: findAndModify
678
+ databaseName: *databaseName
679
+ command:
680
+ findAndModify: *collectionName
681
+ maxTimeMS: { $$type: ["int", "long"] }
682
+ - commandStartedEvent:
683
+ commandName: findAndModify
684
+ databaseName: *databaseName
685
+ command:
686
+ findAndModify: *collectionName
687
+ maxTimeMS: { $$type: ["int", "long"] }
688
+ - description: "operation is retried multiple times if timeoutMS is zero - findOneAndDelete on collection"
689
+ runOnRequirements:
690
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
691
+ operations:
692
+ - name: failPoint
693
+ object: testRunner
694
+ arguments:
695
+ client: *failPointClient
696
+ failPoint:
697
+ configureFailPoint: failCommand
698
+ mode: { times: 2 }
699
+ data:
700
+ failCommands: ["findAndModify"]
701
+ errorCode: 7
702
+ closeConnection: false
703
+ errorLabels: ["RetryableWriteError"]
704
+ - name: findOneAndDelete
705
+ object: *collection
706
+ arguments:
707
+ timeoutMS: 0
708
+ filter: {}
709
+
710
+ expectEvents:
711
+ - client: *client
712
+ events:
713
+ - commandStartedEvent:
714
+ commandName: findAndModify
715
+ databaseName: *databaseName
716
+ command:
717
+ findAndModify: *collectionName
718
+ maxTimeMS: { $$exists: false }
719
+ - commandStartedEvent:
720
+ commandName: findAndModify
721
+ databaseName: *databaseName
722
+ command:
723
+ findAndModify: *collectionName
724
+ maxTimeMS: { $$exists: false }
725
+ - commandStartedEvent:
726
+ commandName: findAndModify
727
+ databaseName: *databaseName
728
+ command:
729
+ findAndModify: *collectionName
730
+ maxTimeMS: { $$exists: false }
731
+ - description: "timeoutMS applies to whole operation, not individual attempts - findOneAndReplace on collection"
732
+ runOnRequirements:
733
+ - minServerVersion: "4.4"
734
+ operations:
735
+ - name: failPoint
736
+ object: testRunner
737
+ arguments:
738
+ client: *failPointClient
739
+ failPoint:
740
+ configureFailPoint: failCommand
741
+ mode: { times: 4 }
742
+ data:
743
+ failCommands: ["findAndModify"]
744
+ blockConnection: true
745
+ blockTimeMS: 60
746
+ errorCode: 7
747
+ errorLabels: ["RetryableWriteError"]
748
+ - name: findOneAndReplace
749
+ object: *collection
750
+ arguments:
751
+ filter: {}
752
+ replacement: { x: 1 }
753
+
754
+ expectError:
755
+ isTimeoutError: true
756
+ - description: "operation is retried multiple times for non-zero timeoutMS - findOneAndReplace on collection"
757
+ runOnRequirements:
758
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
759
+ operations:
760
+ - name: failPoint
761
+ object: testRunner
762
+ arguments:
763
+ client: *failPointClient
764
+ failPoint:
765
+ configureFailPoint: failCommand
766
+ mode: { times: 2 }
767
+ data:
768
+ failCommands: ["findAndModify"]
769
+ errorCode: 7
770
+ closeConnection: false
771
+ errorLabels: ["RetryableWriteError"]
772
+ - name: findOneAndReplace
773
+ object: *collection
774
+ arguments:
775
+ timeoutMS: 1000
776
+ filter: {}
777
+ replacement: { x: 1 }
778
+
779
+ expectEvents:
780
+ - client: *client
781
+ events:
782
+ - commandStartedEvent:
783
+ commandName: findAndModify
784
+ databaseName: *databaseName
785
+ command:
786
+ findAndModify: *collectionName
787
+ maxTimeMS: { $$type: ["int", "long"] }
788
+ - commandStartedEvent:
789
+ commandName: findAndModify
790
+ databaseName: *databaseName
791
+ command:
792
+ findAndModify: *collectionName
793
+ maxTimeMS: { $$type: ["int", "long"] }
794
+ - commandStartedEvent:
795
+ commandName: findAndModify
796
+ databaseName: *databaseName
797
+ command:
798
+ findAndModify: *collectionName
799
+ maxTimeMS: { $$type: ["int", "long"] }
800
+ - description: "operation is retried multiple times if timeoutMS is zero - findOneAndReplace on collection"
801
+ runOnRequirements:
802
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
803
+ operations:
804
+ - name: failPoint
805
+ object: testRunner
806
+ arguments:
807
+ client: *failPointClient
808
+ failPoint:
809
+ configureFailPoint: failCommand
810
+ mode: { times: 2 }
811
+ data:
812
+ failCommands: ["findAndModify"]
813
+ errorCode: 7
814
+ closeConnection: false
815
+ errorLabels: ["RetryableWriteError"]
816
+ - name: findOneAndReplace
817
+ object: *collection
818
+ arguments:
819
+ timeoutMS: 0
820
+ filter: {}
821
+ replacement: { x: 1 }
822
+
823
+ expectEvents:
824
+ - client: *client
825
+ events:
826
+ - commandStartedEvent:
827
+ commandName: findAndModify
828
+ databaseName: *databaseName
829
+ command:
830
+ findAndModify: *collectionName
831
+ maxTimeMS: { $$exists: false }
832
+ - commandStartedEvent:
833
+ commandName: findAndModify
834
+ databaseName: *databaseName
835
+ command:
836
+ findAndModify: *collectionName
837
+ maxTimeMS: { $$exists: false }
838
+ - commandStartedEvent:
839
+ commandName: findAndModify
840
+ databaseName: *databaseName
841
+ command:
842
+ findAndModify: *collectionName
843
+ maxTimeMS: { $$exists: false }
844
+ - description: "timeoutMS applies to whole operation, not individual attempts - findOneAndUpdate on collection"
845
+ runOnRequirements:
846
+ - minServerVersion: "4.4"
847
+ operations:
848
+ - name: failPoint
849
+ object: testRunner
850
+ arguments:
851
+ client: *failPointClient
852
+ failPoint:
853
+ configureFailPoint: failCommand
854
+ mode: { times: 4 }
855
+ data:
856
+ failCommands: ["findAndModify"]
857
+ blockConnection: true
858
+ blockTimeMS: 60
859
+ errorCode: 7
860
+ errorLabels: ["RetryableWriteError"]
861
+ - name: findOneAndUpdate
862
+ object: *collection
863
+ arguments:
864
+ filter: {}
865
+ update: { $set: { x: 1 } }
866
+
867
+ expectError:
868
+ isTimeoutError: true
869
+ - description: "operation is retried multiple times for non-zero timeoutMS - findOneAndUpdate on collection"
870
+ runOnRequirements:
871
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
872
+ operations:
873
+ - name: failPoint
874
+ object: testRunner
875
+ arguments:
876
+ client: *failPointClient
877
+ failPoint:
878
+ configureFailPoint: failCommand
879
+ mode: { times: 2 }
880
+ data:
881
+ failCommands: ["findAndModify"]
882
+ errorCode: 7
883
+ closeConnection: false
884
+ errorLabels: ["RetryableWriteError"]
885
+ - name: findOneAndUpdate
886
+ object: *collection
887
+ arguments:
888
+ timeoutMS: 1000
889
+ filter: {}
890
+ update: { $set: { x: 1 } }
891
+
892
+ expectEvents:
893
+ - client: *client
894
+ events:
895
+ - commandStartedEvent:
896
+ commandName: findAndModify
897
+ databaseName: *databaseName
898
+ command:
899
+ findAndModify: *collectionName
900
+ maxTimeMS: { $$type: ["int", "long"] }
901
+ - commandStartedEvent:
902
+ commandName: findAndModify
903
+ databaseName: *databaseName
904
+ command:
905
+ findAndModify: *collectionName
906
+ maxTimeMS: { $$type: ["int", "long"] }
907
+ - commandStartedEvent:
908
+ commandName: findAndModify
909
+ databaseName: *databaseName
910
+ command:
911
+ findAndModify: *collectionName
912
+ maxTimeMS: { $$type: ["int", "long"] }
913
+ - description: "operation is retried multiple times if timeoutMS is zero - findOneAndUpdate on collection"
914
+ runOnRequirements:
915
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
916
+ operations:
917
+ - name: failPoint
918
+ object: testRunner
919
+ arguments:
920
+ client: *failPointClient
921
+ failPoint:
922
+ configureFailPoint: failCommand
923
+ mode: { times: 2 }
924
+ data:
925
+ failCommands: ["findAndModify"]
926
+ errorCode: 7
927
+ closeConnection: false
928
+ errorLabels: ["RetryableWriteError"]
929
+ - name: findOneAndUpdate
930
+ object: *collection
931
+ arguments:
932
+ timeoutMS: 0
933
+ filter: {}
934
+ update: { $set: { x: 1 } }
935
+
936
+ expectEvents:
937
+ - client: *client
938
+ events:
939
+ - commandStartedEvent:
940
+ commandName: findAndModify
941
+ databaseName: *databaseName
942
+ command:
943
+ findAndModify: *collectionName
944
+ maxTimeMS: { $$exists: false }
945
+ - commandStartedEvent:
946
+ commandName: findAndModify
947
+ databaseName: *databaseName
948
+ command:
949
+ findAndModify: *collectionName
950
+ maxTimeMS: { $$exists: false }
951
+ - commandStartedEvent:
952
+ commandName: findAndModify
953
+ databaseName: *databaseName
954
+ command:
955
+ findAndModify: *collectionName
956
+ maxTimeMS: { $$exists: false }
957
+ - description: "timeoutMS applies to whole operation, not individual attempts - bulkWrite on collection"
958
+ runOnRequirements:
959
+ - minServerVersion: "4.4"
960
+ operations:
961
+ - name: failPoint
962
+ object: testRunner
963
+ arguments:
964
+ client: *failPointClient
965
+ failPoint:
966
+ configureFailPoint: failCommand
967
+ mode: { times: 4 }
968
+ data:
969
+ failCommands: ["insert"]
970
+ blockConnection: true
971
+ blockTimeMS: 60
972
+ errorCode: 7
973
+ errorLabels: ["RetryableWriteError"]
974
+ - name: bulkWrite
975
+ object: *collection
976
+ arguments:
977
+ requests:
978
+ - insertOne:
979
+ document: { _id: 1 }
980
+
981
+ expectError:
982
+ isTimeoutError: true
983
+ - description: "operation is retried multiple times for non-zero timeoutMS - bulkWrite on collection"
984
+ runOnRequirements:
985
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
986
+ operations:
987
+ - name: failPoint
988
+ object: testRunner
989
+ arguments:
990
+ client: *failPointClient
991
+ failPoint:
992
+ configureFailPoint: failCommand
993
+ mode: { times: 2 }
994
+ data:
995
+ failCommands: ["insert"]
996
+ errorCode: 7
997
+ closeConnection: false
998
+ errorLabels: ["RetryableWriteError"]
999
+ - name: bulkWrite
1000
+ object: *collection
1001
+ arguments:
1002
+ timeoutMS: 1000
1003
+ requests:
1004
+ - insertOne:
1005
+ document: { _id: 1 }
1006
+
1007
+ expectEvents:
1008
+ - client: *client
1009
+ events:
1010
+ - commandStartedEvent:
1011
+ commandName: insert
1012
+ databaseName: *databaseName
1013
+ command:
1014
+ insert: *collectionName
1015
+ maxTimeMS: { $$type: ["int", "long"] }
1016
+ - commandStartedEvent:
1017
+ commandName: insert
1018
+ databaseName: *databaseName
1019
+ command:
1020
+ insert: *collectionName
1021
+ maxTimeMS: { $$type: ["int", "long"] }
1022
+ - commandStartedEvent:
1023
+ commandName: insert
1024
+ databaseName: *databaseName
1025
+ command:
1026
+ insert: *collectionName
1027
+ maxTimeMS: { $$type: ["int", "long"] }
1028
+ - description: "operation is retried multiple times if timeoutMS is zero - bulkWrite on collection"
1029
+ runOnRequirements:
1030
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1031
+ operations:
1032
+ - name: failPoint
1033
+ object: testRunner
1034
+ arguments:
1035
+ client: *failPointClient
1036
+ failPoint:
1037
+ configureFailPoint: failCommand
1038
+ mode: { times: 2 }
1039
+ data:
1040
+ failCommands: ["insert"]
1041
+ errorCode: 7
1042
+ closeConnection: false
1043
+ errorLabels: ["RetryableWriteError"]
1044
+ - name: bulkWrite
1045
+ object: *collection
1046
+ arguments:
1047
+ timeoutMS: 0
1048
+ requests:
1049
+ - insertOne:
1050
+ document: { _id: 1 }
1051
+
1052
+ expectEvents:
1053
+ - client: *client
1054
+ events:
1055
+ - commandStartedEvent:
1056
+ commandName: insert
1057
+ databaseName: *databaseName
1058
+ command:
1059
+ insert: *collectionName
1060
+ maxTimeMS: { $$exists: false }
1061
+ - commandStartedEvent:
1062
+ commandName: insert
1063
+ databaseName: *databaseName
1064
+ command:
1065
+ insert: *collectionName
1066
+ maxTimeMS: { $$exists: false }
1067
+ - commandStartedEvent:
1068
+ commandName: insert
1069
+ databaseName: *databaseName
1070
+ command:
1071
+ insert: *collectionName
1072
+ maxTimeMS: { $$exists: false }
1073
+ - description: "timeoutMS applies to whole operation, not individual attempts - listDatabases on client"
1074
+ runOnRequirements:
1075
+ - minServerVersion: "4.4"
1076
+ operations:
1077
+ - name: failPoint
1078
+ object: testRunner
1079
+ arguments:
1080
+ client: *failPointClient
1081
+ failPoint:
1082
+ configureFailPoint: failCommand
1083
+ mode: { times: 4 }
1084
+ data:
1085
+ failCommands: ["listDatabases"]
1086
+ blockConnection: true
1087
+ blockTimeMS: 60
1088
+ errorCode: 7
1089
+ errorLabels: ["RetryableWriteError"]
1090
+ - name: listDatabases
1091
+ object: *client
1092
+ arguments:
1093
+ filter: {}
1094
+
1095
+ expectError:
1096
+ isTimeoutError: true
1097
+ - description: "operation is retried multiple times for non-zero timeoutMS - listDatabases on client"
1098
+ runOnRequirements:
1099
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1100
+ operations:
1101
+ - name: failPoint
1102
+ object: testRunner
1103
+ arguments:
1104
+ client: *failPointClient
1105
+ failPoint:
1106
+ configureFailPoint: failCommand
1107
+ mode: { times: 2 }
1108
+ data:
1109
+ failCommands: ["listDatabases"]
1110
+ errorCode: 7
1111
+ closeConnection: false
1112
+ errorLabels: ["RetryableWriteError"]
1113
+ - name: listDatabases
1114
+ object: *client
1115
+ arguments:
1116
+ timeoutMS: 1000
1117
+ filter: {}
1118
+
1119
+ expectEvents:
1120
+ - client: *client
1121
+ events:
1122
+ - commandStartedEvent:
1123
+ commandName: listDatabases
1124
+ databaseName: admin
1125
+ command:
1126
+ listDatabases: 1
1127
+ maxTimeMS: { $$type: ["int", "long"] }
1128
+ - commandStartedEvent:
1129
+ commandName: listDatabases
1130
+ databaseName: admin
1131
+ command:
1132
+ listDatabases: 1
1133
+ maxTimeMS: { $$type: ["int", "long"] }
1134
+ - commandStartedEvent:
1135
+ commandName: listDatabases
1136
+ databaseName: admin
1137
+ command:
1138
+ listDatabases: 1
1139
+ maxTimeMS: { $$type: ["int", "long"] }
1140
+ - description: "operation is retried multiple times if timeoutMS is zero - listDatabases on client"
1141
+ runOnRequirements:
1142
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1143
+ operations:
1144
+ - name: failPoint
1145
+ object: testRunner
1146
+ arguments:
1147
+ client: *failPointClient
1148
+ failPoint:
1149
+ configureFailPoint: failCommand
1150
+ mode: { times: 2 }
1151
+ data:
1152
+ failCommands: ["listDatabases"]
1153
+ errorCode: 7
1154
+ closeConnection: false
1155
+ errorLabels: ["RetryableWriteError"]
1156
+ - name: listDatabases
1157
+ object: *client
1158
+ arguments:
1159
+ timeoutMS: 0
1160
+ filter: {}
1161
+
1162
+ expectEvents:
1163
+ - client: *client
1164
+ events:
1165
+ - commandStartedEvent:
1166
+ commandName: listDatabases
1167
+ databaseName: admin
1168
+ command:
1169
+ listDatabases: 1
1170
+ maxTimeMS: { $$exists: false }
1171
+ - commandStartedEvent:
1172
+ commandName: listDatabases
1173
+ databaseName: admin
1174
+ command:
1175
+ listDatabases: 1
1176
+ maxTimeMS: { $$exists: false }
1177
+ - commandStartedEvent:
1178
+ commandName: listDatabases
1179
+ databaseName: admin
1180
+ command:
1181
+ listDatabases: 1
1182
+ maxTimeMS: { $$exists: false }
1183
+ - description: "timeoutMS applies to whole operation, not individual attempts - listDatabaseNames on client"
1184
+ runOnRequirements:
1185
+ - minServerVersion: "4.4"
1186
+ operations:
1187
+ - name: failPoint
1188
+ object: testRunner
1189
+ arguments:
1190
+ client: *failPointClient
1191
+ failPoint:
1192
+ configureFailPoint: failCommand
1193
+ mode: { times: 4 }
1194
+ data:
1195
+ failCommands: ["listDatabases"]
1196
+ blockConnection: true
1197
+ blockTimeMS: 60
1198
+ errorCode: 7
1199
+ errorLabels: ["RetryableWriteError"]
1200
+ - name: listDatabaseNames
1201
+ object: *client
1202
+
1203
+ expectError:
1204
+ isTimeoutError: true
1205
+ - description: "operation is retried multiple times for non-zero timeoutMS - listDatabaseNames on client"
1206
+ runOnRequirements:
1207
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1208
+ operations:
1209
+ - name: failPoint
1210
+ object: testRunner
1211
+ arguments:
1212
+ client: *failPointClient
1213
+ failPoint:
1214
+ configureFailPoint: failCommand
1215
+ mode: { times: 2 }
1216
+ data:
1217
+ failCommands: ["listDatabases"]
1218
+ errorCode: 7
1219
+ closeConnection: false
1220
+ errorLabels: ["RetryableWriteError"]
1221
+ - name: listDatabaseNames
1222
+ object: *client
1223
+ arguments:
1224
+ timeoutMS: 1000
1225
+
1226
+ expectEvents:
1227
+ - client: *client
1228
+ events:
1229
+ - commandStartedEvent:
1230
+ commandName: listDatabases
1231
+ databaseName: admin
1232
+ command:
1233
+ listDatabases: 1
1234
+ maxTimeMS: { $$type: ["int", "long"] }
1235
+ - commandStartedEvent:
1236
+ commandName: listDatabases
1237
+ databaseName: admin
1238
+ command:
1239
+ listDatabases: 1
1240
+ maxTimeMS: { $$type: ["int", "long"] }
1241
+ - commandStartedEvent:
1242
+ commandName: listDatabases
1243
+ databaseName: admin
1244
+ command:
1245
+ listDatabases: 1
1246
+ maxTimeMS: { $$type: ["int", "long"] }
1247
+ - description: "operation is retried multiple times if timeoutMS is zero - listDatabaseNames on client"
1248
+ runOnRequirements:
1249
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1250
+ operations:
1251
+ - name: failPoint
1252
+ object: testRunner
1253
+ arguments:
1254
+ client: *failPointClient
1255
+ failPoint:
1256
+ configureFailPoint: failCommand
1257
+ mode: { times: 2 }
1258
+ data:
1259
+ failCommands: ["listDatabases"]
1260
+ errorCode: 7
1261
+ closeConnection: false
1262
+ errorLabels: ["RetryableWriteError"]
1263
+ - name: listDatabaseNames
1264
+ object: *client
1265
+ arguments:
1266
+ timeoutMS: 0
1267
+
1268
+ expectEvents:
1269
+ - client: *client
1270
+ events:
1271
+ - commandStartedEvent:
1272
+ commandName: listDatabases
1273
+ databaseName: admin
1274
+ command:
1275
+ listDatabases: 1
1276
+ maxTimeMS: { $$exists: false }
1277
+ - commandStartedEvent:
1278
+ commandName: listDatabases
1279
+ databaseName: admin
1280
+ command:
1281
+ listDatabases: 1
1282
+ maxTimeMS: { $$exists: false }
1283
+ - commandStartedEvent:
1284
+ commandName: listDatabases
1285
+ databaseName: admin
1286
+ command:
1287
+ listDatabases: 1
1288
+ maxTimeMS: { $$exists: false }
1289
+ - description: "timeoutMS applies to whole operation, not individual attempts - createChangeStream on client"
1290
+ runOnRequirements:
1291
+ - minServerVersion: "4.4"
1292
+ operations:
1293
+ - name: failPoint
1294
+ object: testRunner
1295
+ arguments:
1296
+ client: *failPointClient
1297
+ failPoint:
1298
+ configureFailPoint: failCommand
1299
+ mode: { times: 4 }
1300
+ data:
1301
+ failCommands: ["aggregate"]
1302
+ blockConnection: true
1303
+ blockTimeMS: 60
1304
+ errorCode: 7
1305
+ errorLabels: ["RetryableWriteError"]
1306
+ - name: createChangeStream
1307
+ object: *client
1308
+ arguments:
1309
+ pipeline: []
1310
+
1311
+ expectError:
1312
+ isTimeoutError: true
1313
+ - description: "operation is retried multiple times for non-zero timeoutMS - createChangeStream on client"
1314
+ runOnRequirements:
1315
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1316
+ operations:
1317
+ - name: failPoint
1318
+ object: testRunner
1319
+ arguments:
1320
+ client: *failPointClient
1321
+ failPoint:
1322
+ configureFailPoint: failCommand
1323
+ mode: { times: 2 }
1324
+ data:
1325
+ failCommands: ["aggregate"]
1326
+ errorCode: 7
1327
+ closeConnection: false
1328
+ errorLabels: ["RetryableWriteError"]
1329
+ - name: createChangeStream
1330
+ object: *client
1331
+ arguments:
1332
+ timeoutMS: 1000
1333
+ pipeline: []
1334
+
1335
+ expectEvents:
1336
+ - client: *client
1337
+ events:
1338
+ - commandStartedEvent:
1339
+ commandName: aggregate
1340
+ databaseName: admin
1341
+ command:
1342
+ aggregate: 1
1343
+ maxTimeMS: { $$type: ["int", "long"] }
1344
+ - commandStartedEvent:
1345
+ commandName: aggregate
1346
+ databaseName: admin
1347
+ command:
1348
+ aggregate: 1
1349
+ maxTimeMS: { $$type: ["int", "long"] }
1350
+ - commandStartedEvent:
1351
+ commandName: aggregate
1352
+ databaseName: admin
1353
+ command:
1354
+ aggregate: 1
1355
+ maxTimeMS: { $$type: ["int", "long"] }
1356
+ - description: "operation is retried multiple times if timeoutMS is zero - createChangeStream on client"
1357
+ runOnRequirements:
1358
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1359
+ operations:
1360
+ - name: failPoint
1361
+ object: testRunner
1362
+ arguments:
1363
+ client: *failPointClient
1364
+ failPoint:
1365
+ configureFailPoint: failCommand
1366
+ mode: { times: 2 }
1367
+ data:
1368
+ failCommands: ["aggregate"]
1369
+ errorCode: 7
1370
+ closeConnection: false
1371
+ errorLabels: ["RetryableWriteError"]
1372
+ - name: createChangeStream
1373
+ object: *client
1374
+ arguments:
1375
+ timeoutMS: 0
1376
+ pipeline: []
1377
+
1378
+ expectEvents:
1379
+ - client: *client
1380
+ events:
1381
+ - commandStartedEvent:
1382
+ commandName: aggregate
1383
+ databaseName: admin
1384
+ command:
1385
+ aggregate: 1
1386
+ maxTimeMS: { $$exists: false }
1387
+ - commandStartedEvent:
1388
+ commandName: aggregate
1389
+ databaseName: admin
1390
+ command:
1391
+ aggregate: 1
1392
+ maxTimeMS: { $$exists: false }
1393
+ - commandStartedEvent:
1394
+ commandName: aggregate
1395
+ databaseName: admin
1396
+ command:
1397
+ aggregate: 1
1398
+ maxTimeMS: { $$exists: false }
1399
+ - description: "timeoutMS applies to whole operation, not individual attempts - aggregate on database"
1400
+ runOnRequirements:
1401
+ - minServerVersion: "4.4"
1402
+ operations:
1403
+ - name: failPoint
1404
+ object: testRunner
1405
+ arguments:
1406
+ client: *failPointClient
1407
+ failPoint:
1408
+ configureFailPoint: failCommand
1409
+ mode: { times: 4 }
1410
+ data:
1411
+ failCommands: ["aggregate"]
1412
+ blockConnection: true
1413
+ blockTimeMS: 60
1414
+ errorCode: 7
1415
+ errorLabels: ["RetryableWriteError"]
1416
+ - name: aggregate
1417
+ object: *database
1418
+ arguments:
1419
+ pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ]
1420
+
1421
+ expectError:
1422
+ isTimeoutError: true
1423
+ - description: "operation is retried multiple times for non-zero timeoutMS - aggregate on database"
1424
+ runOnRequirements:
1425
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1426
+ operations:
1427
+ - name: failPoint
1428
+ object: testRunner
1429
+ arguments:
1430
+ client: *failPointClient
1431
+ failPoint:
1432
+ configureFailPoint: failCommand
1433
+ mode: { times: 2 }
1434
+ data:
1435
+ failCommands: ["aggregate"]
1436
+ errorCode: 7
1437
+ closeConnection: false
1438
+ errorLabels: ["RetryableWriteError"]
1439
+ - name: aggregate
1440
+ object: *database
1441
+ arguments:
1442
+ timeoutMS: 1000
1443
+ pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ]
1444
+
1445
+ expectEvents:
1446
+ - client: *client
1447
+ events:
1448
+ - commandStartedEvent:
1449
+ commandName: aggregate
1450
+ databaseName: *databaseName
1451
+ command:
1452
+ aggregate: 1
1453
+ maxTimeMS: { $$type: ["int", "long"] }
1454
+ - commandStartedEvent:
1455
+ commandName: aggregate
1456
+ databaseName: *databaseName
1457
+ command:
1458
+ aggregate: 1
1459
+ maxTimeMS: { $$type: ["int", "long"] }
1460
+ - commandStartedEvent:
1461
+ commandName: aggregate
1462
+ databaseName: *databaseName
1463
+ command:
1464
+ aggregate: 1
1465
+ maxTimeMS: { $$type: ["int", "long"] }
1466
+ - description: "operation is retried multiple times if timeoutMS is zero - aggregate on database"
1467
+ runOnRequirements:
1468
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1469
+ operations:
1470
+ - name: failPoint
1471
+ object: testRunner
1472
+ arguments:
1473
+ client: *failPointClient
1474
+ failPoint:
1475
+ configureFailPoint: failCommand
1476
+ mode: { times: 2 }
1477
+ data:
1478
+ failCommands: ["aggregate"]
1479
+ errorCode: 7
1480
+ closeConnection: false
1481
+ errorLabels: ["RetryableWriteError"]
1482
+ - name: aggregate
1483
+ object: *database
1484
+ arguments:
1485
+ timeoutMS: 0
1486
+ pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ]
1487
+
1488
+ expectEvents:
1489
+ - client: *client
1490
+ events:
1491
+ - commandStartedEvent:
1492
+ commandName: aggregate
1493
+ databaseName: *databaseName
1494
+ command:
1495
+ aggregate: 1
1496
+ maxTimeMS: { $$exists: false }
1497
+ - commandStartedEvent:
1498
+ commandName: aggregate
1499
+ databaseName: *databaseName
1500
+ command:
1501
+ aggregate: 1
1502
+ maxTimeMS: { $$exists: false }
1503
+ - commandStartedEvent:
1504
+ commandName: aggregate
1505
+ databaseName: *databaseName
1506
+ command:
1507
+ aggregate: 1
1508
+ maxTimeMS: { $$exists: false }
1509
+ - description: "timeoutMS applies to whole operation, not individual attempts - listCollections on database"
1510
+ runOnRequirements:
1511
+ - minServerVersion: "4.4"
1512
+ operations:
1513
+ - name: failPoint
1514
+ object: testRunner
1515
+ arguments:
1516
+ client: *failPointClient
1517
+ failPoint:
1518
+ configureFailPoint: failCommand
1519
+ mode: { times: 4 }
1520
+ data:
1521
+ failCommands: ["listCollections"]
1522
+ blockConnection: true
1523
+ blockTimeMS: 60
1524
+ errorCode: 7
1525
+ errorLabels: ["RetryableWriteError"]
1526
+ - name: listCollections
1527
+ object: *database
1528
+ arguments:
1529
+ filter: {}
1530
+
1531
+ expectError:
1532
+ isTimeoutError: true
1533
+ - description: "operation is retried multiple times for non-zero timeoutMS - listCollections on database"
1534
+ runOnRequirements:
1535
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1536
+ operations:
1537
+ - name: failPoint
1538
+ object: testRunner
1539
+ arguments:
1540
+ client: *failPointClient
1541
+ failPoint:
1542
+ configureFailPoint: failCommand
1543
+ mode: { times: 2 }
1544
+ data:
1545
+ failCommands: ["listCollections"]
1546
+ errorCode: 7
1547
+ closeConnection: false
1548
+ errorLabels: ["RetryableWriteError"]
1549
+ - name: listCollections
1550
+ object: *database
1551
+ arguments:
1552
+ timeoutMS: 1000
1553
+ filter: {}
1554
+
1555
+ expectEvents:
1556
+ - client: *client
1557
+ events:
1558
+ - commandStartedEvent:
1559
+ commandName: listCollections
1560
+ databaseName: *databaseName
1561
+ command:
1562
+ listCollections: 1
1563
+ maxTimeMS: { $$type: ["int", "long"] }
1564
+ - commandStartedEvent:
1565
+ commandName: listCollections
1566
+ databaseName: *databaseName
1567
+ command:
1568
+ listCollections: 1
1569
+ maxTimeMS: { $$type: ["int", "long"] }
1570
+ - commandStartedEvent:
1571
+ commandName: listCollections
1572
+ databaseName: *databaseName
1573
+ command:
1574
+ listCollections: 1
1575
+ maxTimeMS: { $$type: ["int", "long"] }
1576
+ - description: "operation is retried multiple times if timeoutMS is zero - listCollections on database"
1577
+ runOnRequirements:
1578
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1579
+ operations:
1580
+ - name: failPoint
1581
+ object: testRunner
1582
+ arguments:
1583
+ client: *failPointClient
1584
+ failPoint:
1585
+ configureFailPoint: failCommand
1586
+ mode: { times: 2 }
1587
+ data:
1588
+ failCommands: ["listCollections"]
1589
+ errorCode: 7
1590
+ closeConnection: false
1591
+ errorLabels: ["RetryableWriteError"]
1592
+ - name: listCollections
1593
+ object: *database
1594
+ arguments:
1595
+ timeoutMS: 0
1596
+ filter: {}
1597
+
1598
+ expectEvents:
1599
+ - client: *client
1600
+ events:
1601
+ - commandStartedEvent:
1602
+ commandName: listCollections
1603
+ databaseName: *databaseName
1604
+ command:
1605
+ listCollections: 1
1606
+ maxTimeMS: { $$exists: false }
1607
+ - commandStartedEvent:
1608
+ commandName: listCollections
1609
+ databaseName: *databaseName
1610
+ command:
1611
+ listCollections: 1
1612
+ maxTimeMS: { $$exists: false }
1613
+ - commandStartedEvent:
1614
+ commandName: listCollections
1615
+ databaseName: *databaseName
1616
+ command:
1617
+ listCollections: 1
1618
+ maxTimeMS: { $$exists: false }
1619
+ - description: "timeoutMS applies to whole operation, not individual attempts - listCollectionNames on database"
1620
+ runOnRequirements:
1621
+ - minServerVersion: "4.4"
1622
+ operations:
1623
+ - name: failPoint
1624
+ object: testRunner
1625
+ arguments:
1626
+ client: *failPointClient
1627
+ failPoint:
1628
+ configureFailPoint: failCommand
1629
+ mode: { times: 4 }
1630
+ data:
1631
+ failCommands: ["listCollections"]
1632
+ blockConnection: true
1633
+ blockTimeMS: 60
1634
+ errorCode: 7
1635
+ errorLabels: ["RetryableWriteError"]
1636
+ - name: listCollectionNames
1637
+ object: *database
1638
+ arguments:
1639
+ filter: {}
1640
+
1641
+ expectError:
1642
+ isTimeoutError: true
1643
+ - description: "operation is retried multiple times for non-zero timeoutMS - listCollectionNames on database"
1644
+ runOnRequirements:
1645
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1646
+ operations:
1647
+ - name: failPoint
1648
+ object: testRunner
1649
+ arguments:
1650
+ client: *failPointClient
1651
+ failPoint:
1652
+ configureFailPoint: failCommand
1653
+ mode: { times: 2 }
1654
+ data:
1655
+ failCommands: ["listCollections"]
1656
+ errorCode: 7
1657
+ closeConnection: false
1658
+ errorLabels: ["RetryableWriteError"]
1659
+ - name: listCollectionNames
1660
+ object: *database
1661
+ arguments:
1662
+ timeoutMS: 1000
1663
+ filter: {}
1664
+
1665
+ expectEvents:
1666
+ - client: *client
1667
+ events:
1668
+ - commandStartedEvent:
1669
+ commandName: listCollections
1670
+ databaseName: *databaseName
1671
+ command:
1672
+ listCollections: 1
1673
+ maxTimeMS: { $$type: ["int", "long"] }
1674
+ - commandStartedEvent:
1675
+ commandName: listCollections
1676
+ databaseName: *databaseName
1677
+ command:
1678
+ listCollections: 1
1679
+ maxTimeMS: { $$type: ["int", "long"] }
1680
+ - commandStartedEvent:
1681
+ commandName: listCollections
1682
+ databaseName: *databaseName
1683
+ command:
1684
+ listCollections: 1
1685
+ maxTimeMS: { $$type: ["int", "long"] }
1686
+ - description: "operation is retried multiple times if timeoutMS is zero - listCollectionNames on database"
1687
+ runOnRequirements:
1688
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1689
+ operations:
1690
+ - name: failPoint
1691
+ object: testRunner
1692
+ arguments:
1693
+ client: *failPointClient
1694
+ failPoint:
1695
+ configureFailPoint: failCommand
1696
+ mode: { times: 2 }
1697
+ data:
1698
+ failCommands: ["listCollections"]
1699
+ errorCode: 7
1700
+ closeConnection: false
1701
+ errorLabels: ["RetryableWriteError"]
1702
+ - name: listCollectionNames
1703
+ object: *database
1704
+ arguments:
1705
+ timeoutMS: 0
1706
+ filter: {}
1707
+
1708
+ expectEvents:
1709
+ - client: *client
1710
+ events:
1711
+ - commandStartedEvent:
1712
+ commandName: listCollections
1713
+ databaseName: *databaseName
1714
+ command:
1715
+ listCollections: 1
1716
+ maxTimeMS: { $$exists: false }
1717
+ - commandStartedEvent:
1718
+ commandName: listCollections
1719
+ databaseName: *databaseName
1720
+ command:
1721
+ listCollections: 1
1722
+ maxTimeMS: { $$exists: false }
1723
+ - commandStartedEvent:
1724
+ commandName: listCollections
1725
+ databaseName: *databaseName
1726
+ command:
1727
+ listCollections: 1
1728
+ maxTimeMS: { $$exists: false }
1729
+ - description: "timeoutMS applies to whole operation, not individual attempts - createChangeStream on database"
1730
+ runOnRequirements:
1731
+ - minServerVersion: "4.4"
1732
+ operations:
1733
+ - name: failPoint
1734
+ object: testRunner
1735
+ arguments:
1736
+ client: *failPointClient
1737
+ failPoint:
1738
+ configureFailPoint: failCommand
1739
+ mode: { times: 4 }
1740
+ data:
1741
+ failCommands: ["aggregate"]
1742
+ blockConnection: true
1743
+ blockTimeMS: 60
1744
+ errorCode: 7
1745
+ errorLabels: ["RetryableWriteError"]
1746
+ - name: createChangeStream
1747
+ object: *database
1748
+ arguments:
1749
+ pipeline: []
1750
+
1751
+ expectError:
1752
+ isTimeoutError: true
1753
+ - description: "operation is retried multiple times for non-zero timeoutMS - createChangeStream on database"
1754
+ runOnRequirements:
1755
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1756
+ operations:
1757
+ - name: failPoint
1758
+ object: testRunner
1759
+ arguments:
1760
+ client: *failPointClient
1761
+ failPoint:
1762
+ configureFailPoint: failCommand
1763
+ mode: { times: 2 }
1764
+ data:
1765
+ failCommands: ["aggregate"]
1766
+ errorCode: 7
1767
+ closeConnection: false
1768
+ errorLabels: ["RetryableWriteError"]
1769
+ - name: createChangeStream
1770
+ object: *database
1771
+ arguments:
1772
+ timeoutMS: 1000
1773
+ pipeline: []
1774
+
1775
+ expectEvents:
1776
+ - client: *client
1777
+ events:
1778
+ - commandStartedEvent:
1779
+ commandName: aggregate
1780
+ databaseName: *databaseName
1781
+ command:
1782
+ aggregate: 1
1783
+ maxTimeMS: { $$type: ["int", "long"] }
1784
+ - commandStartedEvent:
1785
+ commandName: aggregate
1786
+ databaseName: *databaseName
1787
+ command:
1788
+ aggregate: 1
1789
+ maxTimeMS: { $$type: ["int", "long"] }
1790
+ - commandStartedEvent:
1791
+ commandName: aggregate
1792
+ databaseName: *databaseName
1793
+ command:
1794
+ aggregate: 1
1795
+ maxTimeMS: { $$type: ["int", "long"] }
1796
+ - description: "operation is retried multiple times if timeoutMS is zero - createChangeStream on database"
1797
+ runOnRequirements:
1798
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1799
+ operations:
1800
+ - name: failPoint
1801
+ object: testRunner
1802
+ arguments:
1803
+ client: *failPointClient
1804
+ failPoint:
1805
+ configureFailPoint: failCommand
1806
+ mode: { times: 2 }
1807
+ data:
1808
+ failCommands: ["aggregate"]
1809
+ errorCode: 7
1810
+ closeConnection: false
1811
+ errorLabels: ["RetryableWriteError"]
1812
+ - name: createChangeStream
1813
+ object: *database
1814
+ arguments:
1815
+ timeoutMS: 0
1816
+ pipeline: []
1817
+
1818
+ expectEvents:
1819
+ - client: *client
1820
+ events:
1821
+ - commandStartedEvent:
1822
+ commandName: aggregate
1823
+ databaseName: *databaseName
1824
+ command:
1825
+ aggregate: 1
1826
+ maxTimeMS: { $$exists: false }
1827
+ - commandStartedEvent:
1828
+ commandName: aggregate
1829
+ databaseName: *databaseName
1830
+ command:
1831
+ aggregate: 1
1832
+ maxTimeMS: { $$exists: false }
1833
+ - commandStartedEvent:
1834
+ commandName: aggregate
1835
+ databaseName: *databaseName
1836
+ command:
1837
+ aggregate: 1
1838
+ maxTimeMS: { $$exists: false }
1839
+ - description: "timeoutMS applies to whole operation, not individual attempts - aggregate on collection"
1840
+ runOnRequirements:
1841
+ - minServerVersion: "4.4"
1842
+ operations:
1843
+ - name: failPoint
1844
+ object: testRunner
1845
+ arguments:
1846
+ client: *failPointClient
1847
+ failPoint:
1848
+ configureFailPoint: failCommand
1849
+ mode: { times: 4 }
1850
+ data:
1851
+ failCommands: ["aggregate"]
1852
+ blockConnection: true
1853
+ blockTimeMS: 60
1854
+ errorCode: 7
1855
+ errorLabels: ["RetryableWriteError"]
1856
+ - name: aggregate
1857
+ object: *collection
1858
+ arguments:
1859
+ pipeline: []
1860
+
1861
+ expectError:
1862
+ isTimeoutError: true
1863
+ - description: "operation is retried multiple times for non-zero timeoutMS - aggregate on collection"
1864
+ runOnRequirements:
1865
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1866
+ operations:
1867
+ - name: failPoint
1868
+ object: testRunner
1869
+ arguments:
1870
+ client: *failPointClient
1871
+ failPoint:
1872
+ configureFailPoint: failCommand
1873
+ mode: { times: 2 }
1874
+ data:
1875
+ failCommands: ["aggregate"]
1876
+ errorCode: 7
1877
+ closeConnection: false
1878
+ errorLabels: ["RetryableWriteError"]
1879
+ - name: aggregate
1880
+ object: *collection
1881
+ arguments:
1882
+ timeoutMS: 1000
1883
+ pipeline: []
1884
+
1885
+ expectEvents:
1886
+ - client: *client
1887
+ events:
1888
+ - commandStartedEvent:
1889
+ commandName: aggregate
1890
+ databaseName: *databaseName
1891
+ command:
1892
+ aggregate: *collectionName
1893
+ maxTimeMS: { $$type: ["int", "long"] }
1894
+ - commandStartedEvent:
1895
+ commandName: aggregate
1896
+ databaseName: *databaseName
1897
+ command:
1898
+ aggregate: *collectionName
1899
+ maxTimeMS: { $$type: ["int", "long"] }
1900
+ - commandStartedEvent:
1901
+ commandName: aggregate
1902
+ databaseName: *databaseName
1903
+ command:
1904
+ aggregate: *collectionName
1905
+ maxTimeMS: { $$type: ["int", "long"] }
1906
+ - description: "operation is retried multiple times if timeoutMS is zero - aggregate on collection"
1907
+ runOnRequirements:
1908
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1909
+ operations:
1910
+ - name: failPoint
1911
+ object: testRunner
1912
+ arguments:
1913
+ client: *failPointClient
1914
+ failPoint:
1915
+ configureFailPoint: failCommand
1916
+ mode: { times: 2 }
1917
+ data:
1918
+ failCommands: ["aggregate"]
1919
+ errorCode: 7
1920
+ closeConnection: false
1921
+ errorLabels: ["RetryableWriteError"]
1922
+ - name: aggregate
1923
+ object: *collection
1924
+ arguments:
1925
+ timeoutMS: 0
1926
+ pipeline: []
1927
+
1928
+ expectEvents:
1929
+ - client: *client
1930
+ events:
1931
+ - commandStartedEvent:
1932
+ commandName: aggregate
1933
+ databaseName: *databaseName
1934
+ command:
1935
+ aggregate: *collectionName
1936
+ maxTimeMS: { $$exists: false }
1937
+ - commandStartedEvent:
1938
+ commandName: aggregate
1939
+ databaseName: *databaseName
1940
+ command:
1941
+ aggregate: *collectionName
1942
+ maxTimeMS: { $$exists: false }
1943
+ - commandStartedEvent:
1944
+ commandName: aggregate
1945
+ databaseName: *databaseName
1946
+ command:
1947
+ aggregate: *collectionName
1948
+ maxTimeMS: { $$exists: false }
1949
+ - description: "timeoutMS applies to whole operation, not individual attempts - count on collection"
1950
+ runOnRequirements:
1951
+ - minServerVersion: "4.4"
1952
+ operations:
1953
+ - name: failPoint
1954
+ object: testRunner
1955
+ arguments:
1956
+ client: *failPointClient
1957
+ failPoint:
1958
+ configureFailPoint: failCommand
1959
+ mode: { times: 4 }
1960
+ data:
1961
+ failCommands: ["count"]
1962
+ blockConnection: true
1963
+ blockTimeMS: 60
1964
+ errorCode: 7
1965
+ errorLabels: ["RetryableWriteError"]
1966
+ - name: count
1967
+ object: *collection
1968
+ arguments:
1969
+ filter: {}
1970
+
1971
+ expectError:
1972
+ isTimeoutError: true
1973
+ - description: "operation is retried multiple times for non-zero timeoutMS - count on collection"
1974
+ runOnRequirements:
1975
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
1976
+ operations:
1977
+ - name: failPoint
1978
+ object: testRunner
1979
+ arguments:
1980
+ client: *failPointClient
1981
+ failPoint:
1982
+ configureFailPoint: failCommand
1983
+ mode: { times: 2 }
1984
+ data:
1985
+ failCommands: ["count"]
1986
+ errorCode: 7
1987
+ closeConnection: false
1988
+ errorLabels: ["RetryableWriteError"]
1989
+ - name: count
1990
+ object: *collection
1991
+ arguments:
1992
+ timeoutMS: 1000
1993
+ filter: {}
1994
+
1995
+ expectEvents:
1996
+ - client: *client
1997
+ events:
1998
+ - commandStartedEvent:
1999
+ commandName: count
2000
+ databaseName: *databaseName
2001
+ command:
2002
+ count: *collectionName
2003
+ maxTimeMS: { $$type: ["int", "long"] }
2004
+ - commandStartedEvent:
2005
+ commandName: count
2006
+ databaseName: *databaseName
2007
+ command:
2008
+ count: *collectionName
2009
+ maxTimeMS: { $$type: ["int", "long"] }
2010
+ - commandStartedEvent:
2011
+ commandName: count
2012
+ databaseName: *databaseName
2013
+ command:
2014
+ count: *collectionName
2015
+ maxTimeMS: { $$type: ["int", "long"] }
2016
+ - description: "operation is retried multiple times if timeoutMS is zero - count on collection"
2017
+ runOnRequirements:
2018
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2019
+ operations:
2020
+ - name: failPoint
2021
+ object: testRunner
2022
+ arguments:
2023
+ client: *failPointClient
2024
+ failPoint:
2025
+ configureFailPoint: failCommand
2026
+ mode: { times: 2 }
2027
+ data:
2028
+ failCommands: ["count"]
2029
+ errorCode: 7
2030
+ closeConnection: false
2031
+ errorLabels: ["RetryableWriteError"]
2032
+ - name: count
2033
+ object: *collection
2034
+ arguments:
2035
+ timeoutMS: 0
2036
+ filter: {}
2037
+
2038
+ expectEvents:
2039
+ - client: *client
2040
+ events:
2041
+ - commandStartedEvent:
2042
+ commandName: count
2043
+ databaseName: *databaseName
2044
+ command:
2045
+ count: *collectionName
2046
+ maxTimeMS: { $$exists: false }
2047
+ - commandStartedEvent:
2048
+ commandName: count
2049
+ databaseName: *databaseName
2050
+ command:
2051
+ count: *collectionName
2052
+ maxTimeMS: { $$exists: false }
2053
+ - commandStartedEvent:
2054
+ commandName: count
2055
+ databaseName: *databaseName
2056
+ command:
2057
+ count: *collectionName
2058
+ maxTimeMS: { $$exists: false }
2059
+ - description: "timeoutMS applies to whole operation, not individual attempts - countDocuments on collection"
2060
+ runOnRequirements:
2061
+ - minServerVersion: "4.4"
2062
+ operations:
2063
+ - name: failPoint
2064
+ object: testRunner
2065
+ arguments:
2066
+ client: *failPointClient
2067
+ failPoint:
2068
+ configureFailPoint: failCommand
2069
+ mode: { times: 4 }
2070
+ data:
2071
+ failCommands: ["aggregate"]
2072
+ blockConnection: true
2073
+ blockTimeMS: 60
2074
+ errorCode: 7
2075
+ errorLabels: ["RetryableWriteError"]
2076
+ - name: countDocuments
2077
+ object: *collection
2078
+ arguments:
2079
+ filter: {}
2080
+
2081
+ expectError:
2082
+ isTimeoutError: true
2083
+ - description: "operation is retried multiple times for non-zero timeoutMS - countDocuments on collection"
2084
+ runOnRequirements:
2085
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2086
+ operations:
2087
+ - name: failPoint
2088
+ object: testRunner
2089
+ arguments:
2090
+ client: *failPointClient
2091
+ failPoint:
2092
+ configureFailPoint: failCommand
2093
+ mode: { times: 2 }
2094
+ data:
2095
+ failCommands: ["aggregate"]
2096
+ errorCode: 7
2097
+ closeConnection: false
2098
+ errorLabels: ["RetryableWriteError"]
2099
+ - name: countDocuments
2100
+ object: *collection
2101
+ arguments:
2102
+ timeoutMS: 1000
2103
+ filter: {}
2104
+
2105
+ expectEvents:
2106
+ - client: *client
2107
+ events:
2108
+ - commandStartedEvent:
2109
+ commandName: aggregate
2110
+ databaseName: *databaseName
2111
+ command:
2112
+ aggregate: *collectionName
2113
+ maxTimeMS: { $$type: ["int", "long"] }
2114
+ - commandStartedEvent:
2115
+ commandName: aggregate
2116
+ databaseName: *databaseName
2117
+ command:
2118
+ aggregate: *collectionName
2119
+ maxTimeMS: { $$type: ["int", "long"] }
2120
+ - commandStartedEvent:
2121
+ commandName: aggregate
2122
+ databaseName: *databaseName
2123
+ command:
2124
+ aggregate: *collectionName
2125
+ maxTimeMS: { $$type: ["int", "long"] }
2126
+ - description: "operation is retried multiple times if timeoutMS is zero - countDocuments on collection"
2127
+ runOnRequirements:
2128
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2129
+ operations:
2130
+ - name: failPoint
2131
+ object: testRunner
2132
+ arguments:
2133
+ client: *failPointClient
2134
+ failPoint:
2135
+ configureFailPoint: failCommand
2136
+ mode: { times: 2 }
2137
+ data:
2138
+ failCommands: ["aggregate"]
2139
+ errorCode: 7
2140
+ closeConnection: false
2141
+ errorLabels: ["RetryableWriteError"]
2142
+ - name: countDocuments
2143
+ object: *collection
2144
+ arguments:
2145
+ timeoutMS: 0
2146
+ filter: {}
2147
+
2148
+ expectEvents:
2149
+ - client: *client
2150
+ events:
2151
+ - commandStartedEvent:
2152
+ commandName: aggregate
2153
+ databaseName: *databaseName
2154
+ command:
2155
+ aggregate: *collectionName
2156
+ maxTimeMS: { $$exists: false }
2157
+ - commandStartedEvent:
2158
+ commandName: aggregate
2159
+ databaseName: *databaseName
2160
+ command:
2161
+ aggregate: *collectionName
2162
+ maxTimeMS: { $$exists: false }
2163
+ - commandStartedEvent:
2164
+ commandName: aggregate
2165
+ databaseName: *databaseName
2166
+ command:
2167
+ aggregate: *collectionName
2168
+ maxTimeMS: { $$exists: false }
2169
+ - description: "timeoutMS applies to whole operation, not individual attempts - estimatedDocumentCount on collection"
2170
+ runOnRequirements:
2171
+ - minServerVersion: "4.4"
2172
+ operations:
2173
+ - name: failPoint
2174
+ object: testRunner
2175
+ arguments:
2176
+ client: *failPointClient
2177
+ failPoint:
2178
+ configureFailPoint: failCommand
2179
+ mode: { times: 4 }
2180
+ data:
2181
+ failCommands: ["count"]
2182
+ blockConnection: true
2183
+ blockTimeMS: 60
2184
+ errorCode: 7
2185
+ errorLabels: ["RetryableWriteError"]
2186
+ - name: estimatedDocumentCount
2187
+ object: *collection
2188
+
2189
+ expectError:
2190
+ isTimeoutError: true
2191
+ - description: "operation is retried multiple times for non-zero timeoutMS - estimatedDocumentCount on collection"
2192
+ runOnRequirements:
2193
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2194
+ operations:
2195
+ - name: failPoint
2196
+ object: testRunner
2197
+ arguments:
2198
+ client: *failPointClient
2199
+ failPoint:
2200
+ configureFailPoint: failCommand
2201
+ mode: { times: 2 }
2202
+ data:
2203
+ failCommands: ["count"]
2204
+ errorCode: 7
2205
+ closeConnection: false
2206
+ errorLabels: ["RetryableWriteError"]
2207
+ - name: estimatedDocumentCount
2208
+ object: *collection
2209
+ arguments:
2210
+ timeoutMS: 1000
2211
+
2212
+ expectEvents:
2213
+ - client: *client
2214
+ events:
2215
+ - commandStartedEvent:
2216
+ commandName: count
2217
+ databaseName: *databaseName
2218
+ command:
2219
+ count: *collectionName
2220
+ maxTimeMS: { $$type: ["int", "long"] }
2221
+ - commandStartedEvent:
2222
+ commandName: count
2223
+ databaseName: *databaseName
2224
+ command:
2225
+ count: *collectionName
2226
+ maxTimeMS: { $$type: ["int", "long"] }
2227
+ - commandStartedEvent:
2228
+ commandName: count
2229
+ databaseName: *databaseName
2230
+ command:
2231
+ count: *collectionName
2232
+ maxTimeMS: { $$type: ["int", "long"] }
2233
+ - description: "operation is retried multiple times if timeoutMS is zero - estimatedDocumentCount on collection"
2234
+ runOnRequirements:
2235
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2236
+ operations:
2237
+ - name: failPoint
2238
+ object: testRunner
2239
+ arguments:
2240
+ client: *failPointClient
2241
+ failPoint:
2242
+ configureFailPoint: failCommand
2243
+ mode: { times: 2 }
2244
+ data:
2245
+ failCommands: ["count"]
2246
+ errorCode: 7
2247
+ closeConnection: false
2248
+ errorLabels: ["RetryableWriteError"]
2249
+ - name: estimatedDocumentCount
2250
+ object: *collection
2251
+ arguments:
2252
+ timeoutMS: 0
2253
+
2254
+ expectEvents:
2255
+ - client: *client
2256
+ events:
2257
+ - commandStartedEvent:
2258
+ commandName: count
2259
+ databaseName: *databaseName
2260
+ command:
2261
+ count: *collectionName
2262
+ maxTimeMS: { $$exists: false }
2263
+ - commandStartedEvent:
2264
+ commandName: count
2265
+ databaseName: *databaseName
2266
+ command:
2267
+ count: *collectionName
2268
+ maxTimeMS: { $$exists: false }
2269
+ - commandStartedEvent:
2270
+ commandName: count
2271
+ databaseName: *databaseName
2272
+ command:
2273
+ count: *collectionName
2274
+ maxTimeMS: { $$exists: false }
2275
+ - description: "timeoutMS applies to whole operation, not individual attempts - distinct on collection"
2276
+ runOnRequirements:
2277
+ - minServerVersion: "4.4"
2278
+ operations:
2279
+ - name: failPoint
2280
+ object: testRunner
2281
+ arguments:
2282
+ client: *failPointClient
2283
+ failPoint:
2284
+ configureFailPoint: failCommand
2285
+ mode: { times: 4 }
2286
+ data:
2287
+ failCommands: ["distinct"]
2288
+ blockConnection: true
2289
+ blockTimeMS: 60
2290
+ errorCode: 7
2291
+ errorLabels: ["RetryableWriteError"]
2292
+ - name: distinct
2293
+ object: *collection
2294
+ arguments:
2295
+ fieldName: x
2296
+ filter: {}
2297
+
2298
+ expectError:
2299
+ isTimeoutError: true
2300
+ - description: "operation is retried multiple times for non-zero timeoutMS - distinct on collection"
2301
+ runOnRequirements:
2302
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2303
+ operations:
2304
+ - name: failPoint
2305
+ object: testRunner
2306
+ arguments:
2307
+ client: *failPointClient
2308
+ failPoint:
2309
+ configureFailPoint: failCommand
2310
+ mode: { times: 2 }
2311
+ data:
2312
+ failCommands: ["distinct"]
2313
+ errorCode: 7
2314
+ closeConnection: false
2315
+ errorLabels: ["RetryableWriteError"]
2316
+ - name: distinct
2317
+ object: *collection
2318
+ arguments:
2319
+ timeoutMS: 1000
2320
+ fieldName: x
2321
+ filter: {}
2322
+
2323
+ expectEvents:
2324
+ - client: *client
2325
+ events:
2326
+ - commandStartedEvent:
2327
+ commandName: distinct
2328
+ databaseName: *databaseName
2329
+ command:
2330
+ distinct: *collectionName
2331
+ maxTimeMS: { $$type: ["int", "long"] }
2332
+ - commandStartedEvent:
2333
+ commandName: distinct
2334
+ databaseName: *databaseName
2335
+ command:
2336
+ distinct: *collectionName
2337
+ maxTimeMS: { $$type: ["int", "long"] }
2338
+ - commandStartedEvent:
2339
+ commandName: distinct
2340
+ databaseName: *databaseName
2341
+ command:
2342
+ distinct: *collectionName
2343
+ maxTimeMS: { $$type: ["int", "long"] }
2344
+ - description: "operation is retried multiple times if timeoutMS is zero - distinct on collection"
2345
+ runOnRequirements:
2346
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2347
+ operations:
2348
+ - name: failPoint
2349
+ object: testRunner
2350
+ arguments:
2351
+ client: *failPointClient
2352
+ failPoint:
2353
+ configureFailPoint: failCommand
2354
+ mode: { times: 2 }
2355
+ data:
2356
+ failCommands: ["distinct"]
2357
+ errorCode: 7
2358
+ closeConnection: false
2359
+ errorLabels: ["RetryableWriteError"]
2360
+ - name: distinct
2361
+ object: *collection
2362
+ arguments:
2363
+ timeoutMS: 0
2364
+ fieldName: x
2365
+ filter: {}
2366
+
2367
+ expectEvents:
2368
+ - client: *client
2369
+ events:
2370
+ - commandStartedEvent:
2371
+ commandName: distinct
2372
+ databaseName: *databaseName
2373
+ command:
2374
+ distinct: *collectionName
2375
+ maxTimeMS: { $$exists: false }
2376
+ - commandStartedEvent:
2377
+ commandName: distinct
2378
+ databaseName: *databaseName
2379
+ command:
2380
+ distinct: *collectionName
2381
+ maxTimeMS: { $$exists: false }
2382
+ - commandStartedEvent:
2383
+ commandName: distinct
2384
+ databaseName: *databaseName
2385
+ command:
2386
+ distinct: *collectionName
2387
+ maxTimeMS: { $$exists: false }
2388
+ - description: "timeoutMS applies to whole operation, not individual attempts - find on collection"
2389
+ runOnRequirements:
2390
+ - minServerVersion: "4.4"
2391
+ operations:
2392
+ - name: failPoint
2393
+ object: testRunner
2394
+ arguments:
2395
+ client: *failPointClient
2396
+ failPoint:
2397
+ configureFailPoint: failCommand
2398
+ mode: { times: 4 }
2399
+ data:
2400
+ failCommands: ["find"]
2401
+ blockConnection: true
2402
+ blockTimeMS: 60
2403
+ errorCode: 7
2404
+ errorLabels: ["RetryableWriteError"]
2405
+ - name: find
2406
+ object: *collection
2407
+ arguments:
2408
+ filter: {}
2409
+
2410
+ expectError:
2411
+ isTimeoutError: true
2412
+ - description: "operation is retried multiple times for non-zero timeoutMS - find on collection"
2413
+ runOnRequirements:
2414
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2415
+ operations:
2416
+ - name: failPoint
2417
+ object: testRunner
2418
+ arguments:
2419
+ client: *failPointClient
2420
+ failPoint:
2421
+ configureFailPoint: failCommand
2422
+ mode: { times: 2 }
2423
+ data:
2424
+ failCommands: ["find"]
2425
+ errorCode: 7
2426
+ closeConnection: false
2427
+ errorLabels: ["RetryableWriteError"]
2428
+ - name: find
2429
+ object: *collection
2430
+ arguments:
2431
+ timeoutMS: 1000
2432
+ filter: {}
2433
+
2434
+ expectEvents:
2435
+ - client: *client
2436
+ events:
2437
+ - commandStartedEvent:
2438
+ commandName: find
2439
+ databaseName: *databaseName
2440
+ command:
2441
+ find: *collectionName
2442
+ maxTimeMS: { $$type: ["int", "long"] }
2443
+ - commandStartedEvent:
2444
+ commandName: find
2445
+ databaseName: *databaseName
2446
+ command:
2447
+ find: *collectionName
2448
+ maxTimeMS: { $$type: ["int", "long"] }
2449
+ - commandStartedEvent:
2450
+ commandName: find
2451
+ databaseName: *databaseName
2452
+ command:
2453
+ find: *collectionName
2454
+ maxTimeMS: { $$type: ["int", "long"] }
2455
+ - description: "operation is retried multiple times if timeoutMS is zero - find on collection"
2456
+ runOnRequirements:
2457
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2458
+ operations:
2459
+ - name: failPoint
2460
+ object: testRunner
2461
+ arguments:
2462
+ client: *failPointClient
2463
+ failPoint:
2464
+ configureFailPoint: failCommand
2465
+ mode: { times: 2 }
2466
+ data:
2467
+ failCommands: ["find"]
2468
+ errorCode: 7
2469
+ closeConnection: false
2470
+ errorLabels: ["RetryableWriteError"]
2471
+ - name: find
2472
+ object: *collection
2473
+ arguments:
2474
+ timeoutMS: 0
2475
+ filter: {}
2476
+
2477
+ expectEvents:
2478
+ - client: *client
2479
+ events:
2480
+ - commandStartedEvent:
2481
+ commandName: find
2482
+ databaseName: *databaseName
2483
+ command:
2484
+ find: *collectionName
2485
+ maxTimeMS: { $$exists: false }
2486
+ - commandStartedEvent:
2487
+ commandName: find
2488
+ databaseName: *databaseName
2489
+ command:
2490
+ find: *collectionName
2491
+ maxTimeMS: { $$exists: false }
2492
+ - commandStartedEvent:
2493
+ commandName: find
2494
+ databaseName: *databaseName
2495
+ command:
2496
+ find: *collectionName
2497
+ maxTimeMS: { $$exists: false }
2498
+ - description: "timeoutMS applies to whole operation, not individual attempts - findOne on collection"
2499
+ runOnRequirements:
2500
+ - minServerVersion: "4.4"
2501
+ operations:
2502
+ - name: failPoint
2503
+ object: testRunner
2504
+ arguments:
2505
+ client: *failPointClient
2506
+ failPoint:
2507
+ configureFailPoint: failCommand
2508
+ mode: { times: 4 }
2509
+ data:
2510
+ failCommands: ["find"]
2511
+ blockConnection: true
2512
+ blockTimeMS: 60
2513
+ errorCode: 7
2514
+ errorLabels: ["RetryableWriteError"]
2515
+ - name: findOne
2516
+ object: *collection
2517
+ arguments:
2518
+ filter: {}
2519
+
2520
+ expectError:
2521
+ isTimeoutError: true
2522
+ - description: "operation is retried multiple times for non-zero timeoutMS - findOne on collection"
2523
+ runOnRequirements:
2524
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2525
+ operations:
2526
+ - name: failPoint
2527
+ object: testRunner
2528
+ arguments:
2529
+ client: *failPointClient
2530
+ failPoint:
2531
+ configureFailPoint: failCommand
2532
+ mode: { times: 2 }
2533
+ data:
2534
+ failCommands: ["find"]
2535
+ errorCode: 7
2536
+ closeConnection: false
2537
+ errorLabels: ["RetryableWriteError"]
2538
+ - name: findOne
2539
+ object: *collection
2540
+ arguments:
2541
+ timeoutMS: 1000
2542
+ filter: {}
2543
+
2544
+ expectEvents:
2545
+ - client: *client
2546
+ events:
2547
+ - commandStartedEvent:
2548
+ commandName: find
2549
+ databaseName: *databaseName
2550
+ command:
2551
+ find: *collectionName
2552
+ maxTimeMS: { $$type: ["int", "long"] }
2553
+ - commandStartedEvent:
2554
+ commandName: find
2555
+ databaseName: *databaseName
2556
+ command:
2557
+ find: *collectionName
2558
+ maxTimeMS: { $$type: ["int", "long"] }
2559
+ - commandStartedEvent:
2560
+ commandName: find
2561
+ databaseName: *databaseName
2562
+ command:
2563
+ find: *collectionName
2564
+ maxTimeMS: { $$type: ["int", "long"] }
2565
+ - description: "operation is retried multiple times if timeoutMS is zero - findOne on collection"
2566
+ runOnRequirements:
2567
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2568
+ operations:
2569
+ - name: failPoint
2570
+ object: testRunner
2571
+ arguments:
2572
+ client: *failPointClient
2573
+ failPoint:
2574
+ configureFailPoint: failCommand
2575
+ mode: { times: 2 }
2576
+ data:
2577
+ failCommands: ["find"]
2578
+ errorCode: 7
2579
+ closeConnection: false
2580
+ errorLabels: ["RetryableWriteError"]
2581
+ - name: findOne
2582
+ object: *collection
2583
+ arguments:
2584
+ timeoutMS: 0
2585
+ filter: {}
2586
+
2587
+ expectEvents:
2588
+ - client: *client
2589
+ events:
2590
+ - commandStartedEvent:
2591
+ commandName: find
2592
+ databaseName: *databaseName
2593
+ command:
2594
+ find: *collectionName
2595
+ maxTimeMS: { $$exists: false }
2596
+ - commandStartedEvent:
2597
+ commandName: find
2598
+ databaseName: *databaseName
2599
+ command:
2600
+ find: *collectionName
2601
+ maxTimeMS: { $$exists: false }
2602
+ - commandStartedEvent:
2603
+ commandName: find
2604
+ databaseName: *databaseName
2605
+ command:
2606
+ find: *collectionName
2607
+ maxTimeMS: { $$exists: false }
2608
+ - description: "timeoutMS applies to whole operation, not individual attempts - listIndexes on collection"
2609
+ runOnRequirements:
2610
+ - minServerVersion: "4.4"
2611
+ operations:
2612
+ - name: failPoint
2613
+ object: testRunner
2614
+ arguments:
2615
+ client: *failPointClient
2616
+ failPoint:
2617
+ configureFailPoint: failCommand
2618
+ mode: { times: 4 }
2619
+ data:
2620
+ failCommands: ["listIndexes"]
2621
+ blockConnection: true
2622
+ blockTimeMS: 60
2623
+ errorCode: 7
2624
+ errorLabels: ["RetryableWriteError"]
2625
+ - name: listIndexes
2626
+ object: *collection
2627
+
2628
+ expectError:
2629
+ isTimeoutError: true
2630
+ - description: "operation is retried multiple times for non-zero timeoutMS - listIndexes on collection"
2631
+ runOnRequirements:
2632
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2633
+ operations:
2634
+ - name: failPoint
2635
+ object: testRunner
2636
+ arguments:
2637
+ client: *failPointClient
2638
+ failPoint:
2639
+ configureFailPoint: failCommand
2640
+ mode: { times: 2 }
2641
+ data:
2642
+ failCommands: ["listIndexes"]
2643
+ errorCode: 7
2644
+ closeConnection: false
2645
+ errorLabels: ["RetryableWriteError"]
2646
+ - name: listIndexes
2647
+ object: *collection
2648
+ arguments:
2649
+ timeoutMS: 1000
2650
+
2651
+ expectEvents:
2652
+ - client: *client
2653
+ events:
2654
+ - commandStartedEvent:
2655
+ commandName: listIndexes
2656
+ databaseName: *databaseName
2657
+ command:
2658
+ listIndexes: *collectionName
2659
+ maxTimeMS: { $$type: ["int", "long"] }
2660
+ - commandStartedEvent:
2661
+ commandName: listIndexes
2662
+ databaseName: *databaseName
2663
+ command:
2664
+ listIndexes: *collectionName
2665
+ maxTimeMS: { $$type: ["int", "long"] }
2666
+ - commandStartedEvent:
2667
+ commandName: listIndexes
2668
+ databaseName: *databaseName
2669
+ command:
2670
+ listIndexes: *collectionName
2671
+ maxTimeMS: { $$type: ["int", "long"] }
2672
+ - description: "operation is retried multiple times if timeoutMS is zero - listIndexes on collection"
2673
+ runOnRequirements:
2674
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2675
+ operations:
2676
+ - name: failPoint
2677
+ object: testRunner
2678
+ arguments:
2679
+ client: *failPointClient
2680
+ failPoint:
2681
+ configureFailPoint: failCommand
2682
+ mode: { times: 2 }
2683
+ data:
2684
+ failCommands: ["listIndexes"]
2685
+ errorCode: 7
2686
+ closeConnection: false
2687
+ errorLabels: ["RetryableWriteError"]
2688
+ - name: listIndexes
2689
+ object: *collection
2690
+ arguments:
2691
+ timeoutMS: 0
2692
+
2693
+ expectEvents:
2694
+ - client: *client
2695
+ events:
2696
+ - commandStartedEvent:
2697
+ commandName: listIndexes
2698
+ databaseName: *databaseName
2699
+ command:
2700
+ listIndexes: *collectionName
2701
+ maxTimeMS: { $$exists: false }
2702
+ - commandStartedEvent:
2703
+ commandName: listIndexes
2704
+ databaseName: *databaseName
2705
+ command:
2706
+ listIndexes: *collectionName
2707
+ maxTimeMS: { $$exists: false }
2708
+ - commandStartedEvent:
2709
+ commandName: listIndexes
2710
+ databaseName: *databaseName
2711
+ command:
2712
+ listIndexes: *collectionName
2713
+ maxTimeMS: { $$exists: false }
2714
+ - description: "timeoutMS applies to whole operation, not individual attempts - createChangeStream on collection"
2715
+ runOnRequirements:
2716
+ - minServerVersion: "4.4"
2717
+ operations:
2718
+ - name: failPoint
2719
+ object: testRunner
2720
+ arguments:
2721
+ client: *failPointClient
2722
+ failPoint:
2723
+ configureFailPoint: failCommand
2724
+ mode: { times: 4 }
2725
+ data:
2726
+ failCommands: ["aggregate"]
2727
+ blockConnection: true
2728
+ blockTimeMS: 60
2729
+ errorCode: 7
2730
+ errorLabels: ["RetryableWriteError"]
2731
+ - name: createChangeStream
2732
+ object: *collection
2733
+ arguments:
2734
+ pipeline: []
2735
+
2736
+ expectError:
2737
+ isTimeoutError: true
2738
+ - description: "operation is retried multiple times for non-zero timeoutMS - createChangeStream on collection"
2739
+ runOnRequirements:
2740
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2741
+ operations:
2742
+ - name: failPoint
2743
+ object: testRunner
2744
+ arguments:
2745
+ client: *failPointClient
2746
+ failPoint:
2747
+ configureFailPoint: failCommand
2748
+ mode: { times: 2 }
2749
+ data:
2750
+ failCommands: ["aggregate"]
2751
+ errorCode: 7
2752
+ closeConnection: false
2753
+ errorLabels: ["RetryableWriteError"]
2754
+ - name: createChangeStream
2755
+ object: *collection
2756
+ arguments:
2757
+ timeoutMS: 1000
2758
+ pipeline: []
2759
+
2760
+ expectEvents:
2761
+ - client: *client
2762
+ events:
2763
+ - commandStartedEvent:
2764
+ commandName: aggregate
2765
+ databaseName: *databaseName
2766
+ command:
2767
+ aggregate: *collectionName
2768
+ maxTimeMS: { $$type: ["int", "long"] }
2769
+ - commandStartedEvent:
2770
+ commandName: aggregate
2771
+ databaseName: *databaseName
2772
+ command:
2773
+ aggregate: *collectionName
2774
+ maxTimeMS: { $$type: ["int", "long"] }
2775
+ - commandStartedEvent:
2776
+ commandName: aggregate
2777
+ databaseName: *databaseName
2778
+ command:
2779
+ aggregate: *collectionName
2780
+ maxTimeMS: { $$type: ["int", "long"] }
2781
+ - description: "operation is retried multiple times if timeoutMS is zero - createChangeStream on collection"
2782
+ runOnRequirements:
2783
+ - minServerVersion: "4.3.1" # failCommand errorLabels option
2784
+ operations:
2785
+ - name: failPoint
2786
+ object: testRunner
2787
+ arguments:
2788
+ client: *failPointClient
2789
+ failPoint:
2790
+ configureFailPoint: failCommand
2791
+ mode: { times: 2 }
2792
+ data:
2793
+ failCommands: ["aggregate"]
2794
+ errorCode: 7
2795
+ closeConnection: false
2796
+ errorLabels: ["RetryableWriteError"]
2797
+ - name: createChangeStream
2798
+ object: *collection
2799
+ arguments:
2800
+ timeoutMS: 0
2801
+ pipeline: []
2802
+
2803
+ expectEvents:
2804
+ - client: *client
2805
+ events:
2806
+ - commandStartedEvent:
2807
+ commandName: aggregate
2808
+ databaseName: *databaseName
2809
+ command:
2810
+ aggregate: *collectionName
2811
+ maxTimeMS: { $$exists: false }
2812
+ - commandStartedEvent:
2813
+ commandName: aggregate
2814
+ databaseName: *databaseName
2815
+ command:
2816
+ aggregate: *collectionName
2817
+ maxTimeMS: { $$exists: false }
2818
+ - commandStartedEvent:
2819
+ commandName: aggregate
2820
+ databaseName: *databaseName
2821
+ command:
2822
+ aggregate: *collectionName
2823
+ maxTimeMS: { $$exists: false }
2824
+