diff --git a/source/client-backpressure/client-backpressure.md b/source/client-backpressure/client-backpressure.md index 5bf6f211b3..cd77c45e76 100644 --- a/source/client-backpressure/client-backpressure.md +++ b/source/client-backpressure/client-backpressure.md @@ -122,7 +122,9 @@ rules: 2. A retry attempt will only be permitted if: 1. The error is a retryable overload error. 2. We have not reached `MAX_RETRIES`. - - The value of `MAX_RETRIES` is 5 and non-configurable. + - The default value of `MAX_RETRIES` is 2. Drivers MUST expose `maxAdaptiveRetries` as a configurable option for + this maximum. In the future, this default value or the default behavior of the driver may change without being + considered a breaking change. - This intentionally changes the behavior of CSOT which otherwise would retry an unlimited number of times within the timeout to avoid retry storms. 3. (CSOT-only): There is still time for a retry attempt according to the @@ -133,20 +135,17 @@ rules: - To retry `runCommand`, both [retryWrites](../retryable-writes/retryable-writes.md#retrywrites) and [retryReads](../retryable-reads/retryable-reads.md#retryreads) MUST be enabled. See [Why must both `retryWrites` and `retryReads` be enabled to retry runCommand?](client-backpressure.md#why-must-both-retrywrites-and-retryreads-be-enabled-to-retry-runcommand) -3. If the request is eligible for retry (as outlined in step 2 above and step 4 in the - [adaptive retry requirements](client-backpressure.md#adaptive-retry-requirements) below), the client MUST apply - exponential backoff according to the following formula: - `backoff = jitter * min(MAX_BACKOFF, BASE_BACKOFF * 2^(attempt - 1))` +3. If the request is eligible for retry (as outlined in step 2 above), the client MUST apply exponential backoff + according to the following formula: `backoff = jitter * min(MAX_BACKOFF, BASE_BACKOFF * 2^(attempt - 1))` - `jitter` is a random jitter value between 0 and 1. - `BASE_BACKOFF` is constant 100ms. - `MAX_BACKOFF` is 10000ms. - - This results in delays of 100ms, 200ms, 400ms, 800ms, and 1600ms before accounting for jitter. -4. If the request is eligible for retry (as outlined in step 2 above and step 4 in the - [adaptive retry requirements](client-backpressure.md#adaptive-retry-requirements) below), the client MUST add the - previously used server's address to the list of deprioritized server addresses for - [server selection](../server-selection/server-selection.md). -5. If the request is eligible for retry (as outlined in step 2 above and step 4 in the - [adaptive retry requirements](client-backpressure.md#adaptive-retry-requirements) below) and is a retryable write: + - This results in delays of 100ms and 200ms before accounting for jitter. +4. If the request is eligible for retry (as outlined in step 2 above) and `enableOverloadRetargeting` is enabled, the + client MUST add the previously used server's address to the list of deprioritized server addresses for + [server selection](../server-selection/server-selection.md). Drivers MUST expose `enableOverloadRetargeting` as a + configurable boolean option that defaults to `false`. +5. If the request is eligible for retry (as outlined in step 2 above) and is a retryable write: 1. If the command is a part of a transaction, the instructions for command modification on retry for commands in transactions MUST be followed, as outlined in the [transactions](../transactions/transactions.md#interaction-with-retryable-writes) specification. @@ -159,26 +158,12 @@ rules: specifications. - For the purposes of error propagation, `runCommand` is considered a write. -##### Adaptive retry requirements - -If adaptive retries are enabled, the following rules MUST also be obeyed: - -1. If the command succeeds on the first attempt, drivers MUST deposit `RETRY_TOKEN_RETURN_RATE` tokens. - - The value is 0.1 and non-configurable. -2. If the command succeeds on a retry attempt, drivers MUST deposit `RETRY_TOKEN_RETURN_RATE`+1 tokens. -3. If a retry attempt fails with an error that is not an overload error, drivers MUST deposit 1 token. - - An error that does not contain the `SystemOverloadedError` error label indicates that the server is healthy enough - to handle requests. For the purposes of retry budget tracking, this counts as a success. -4. A retry attempt will only be permitted if a token can be consumed from the token bucket. -5. A retry attempt consumes 1 token from the token bucket. - #### Interaction with Other Retry Policies The retry policy in this specification is separate from the other retry policies defined in the [retryable reads](../retryable-reads/retryable-reads.md) and [retryable writes](../retryable-writes/retryable-writes.md) specifications. Drivers MUST ensure: -- Only overload errors consume tokens from the token bucket before retrying. - When a failed attempt is retried, backoff MUST be applied if and only if the error is an overload error. - If an overload error is encountered: - Regardless of whether CSOT is enabled or not, the maximum number of retries for any retry policy becomes @@ -198,8 +183,7 @@ included, such as error handling with `NoWritesPerformed` labels. BASE_BACKOFF = 0.1 # 100ms MAX_BACKOFF = 10 # 10000ms -RETRY_TOKEN_RETURN_RATE = 0.1 -MAX_RETRIES = 5 +MAX_RETRIES = 2 def execute_command_retryable(command, ...): deprioritized_servers = [] @@ -211,12 +195,6 @@ def execute_command_retryable(command, ...): server = select_server(deprioritized_servers) connection = server.getConnection() res = execute_command(connection, command) - if adaptive_retry: - # Deposit tokens into the bucket on success. - tokens = RETRY_TOKEN_RETURN_RATE - if attempt > 0: - tokens += 1 - token_bucket.deposit(tokens) return res except PyMongoError as exc: is_retryable = (is_retryable_write(command, exc) @@ -224,10 +202,6 @@ def execute_command_retryable(command, ...): or (exc.contains_error_label("RetryableError") and exc.contains_error_label("SystemOverloadedError"))) is_overload = exc.contains_error_label("SystemOverloadedError") - # if a retry fails with an error which is not an overload error, deposit 1 token - if adaptive_retry and attempt > 0 and not is_overload: - token_bucket.deposit(1) - # Raise if the error is non-retryable. if not is_retryable: raise @@ -238,8 +212,10 @@ def execute_command_retryable(command, ...): if attempt > allowed_retries: raise - - deprioritized_servers.append(server.address) + + # enableOverloadRetargeting is true + if overload_retargeting: + deprioritized_servers.append(server.address) if is_overload: jitter = random.random() # Random float between [0.0, 1.0). @@ -250,59 +226,9 @@ def execute_command_retryable(command, ...): if time.monotonic() + backoff > _csot.get_deadline(): raise - if adaptive_retry and not token_bucket.consume(1): - raise - time.sleep(backoff) ``` -### Token Bucket - -The overload retry policy introduces an opt-in per-client [token bucket](https://en.wikipedia.org/wiki/Token_bucket) to -limit overload error retry attempts. Although the server rejects excess commands as quickly as possible, doing so costs -CPU and creates extra contention on the connection pool which can eventually negatively affect goodput. To reduce this -risk, the token bucket will limit retry attempts during a prolonged overload. - -The token bucket MUST be disabled by default and can be enabled through the -[adaptiveRetries=True](../uri-options/uri-options.md) connection and client options. - -The token bucket starts at its maximum capacity of 1000 for consistency with the server. - -Each MongoClient instance MUST have its own token bucket. When adaptive retries are enabled, the token bucket MUST be -created when the MongoClient is initialized and exist for the lifetime of the MongoClient. Drivers MUST ensure the token -bucket implementation is thread-safe as it may be accessed concurrently by multiple operations. - -#### Pseudocode - -The token bucket is implemented via a thread safe counter. For languages without atomics, this can be implemented via a -lock, for example: - -```python -DEFAULT_RETRY_TOKEN_CAPACITY = 1000 -class TokenBucket: - """A token bucket implementation for rate limiting.""" - def __init__( - self, - capacity: float = DEFAULT_RETRY_TOKEN_CAPACITY, - ): - self.lock = Lock() - self.capacity = capacity - self.tokens = capacity - - def consume(self, n: float) -> bool: - """Consume n tokens from the bucket if available.""" - with self.lock: - if self.tokens >= n: - self.tokens -= n - return True - return False - - def deposit(self, n: float) -> None: - """Deposit n tokens back into the bucket.""" - with self.lock: - self.tokens = min(self.capacity, self.tokens + n) -``` - #### Handshake changes Drivers conforming to this spec MUST add `"backpressure": True` to the @@ -466,8 +392,44 @@ Additionally, both `retryReads` and `retryWrites` are enabled by default, so for retried. This approach also prevents accidentally retrying a read command when only `retryWrites` is enabled, or retrying a write command when only `retryReads` is enabled. +### Why make `maxAdaptiveRetries` configurable? + +Modelling and the underpinning theory for backpressure shows that the n-retries approach (retry up to N times on +overload errors without a token bucket) can introduce retry storms as overload increases. However, the specifics of the +workload and cluster serving that workload significantly impacts the threshold at which retry volume becomes an +additional burden rather than a throughput improvement. Some applications and clusters may be very tolerant of many +additional retries, while others may want to break out of the loop much earlier. + +The selection of 2 as a default attempts to broadly pick a sensible default for most users that will on average be a +benefit rather than a negative during overload. However, savvy users, the users expected to be most affected by overload +and have the most insight into the specifics of their workload and cluster, will likely find that tweaking this value on +a per-workload basis produces better results. Additionally, there are situations where disabling overload retries +entirely is optimal, such as non-critical workloads against a cluster shared with critical workloads. Without a knob, +those situations will cause users to either have a strictly worse experience with a new driver, or force them to +downgrade to an older driver to avoid the issue. These are two strong motivations to add a knob for +`maxAdaptiveRetries`. + +### Why make `enableOverloadRetargeting` configurable? + +The current contract we've made with users utilizing `primaryPreferred` is that reads will only go to a secondary if the +primary is unavailable. The documentation does not explicitly define unavailable, but in practice that means the primary +is unselectable. Overload retargeting makes the primary unselectable for a retry operation if it returned an overload +error on a previous attempt. This materially changes how often secondary reads occur. Since secondary reads can result +in stale data, enabling overload retargeting increases the chance that users of `primaryPreferred` will get stale data +when they did not previously. This is a semantic change, and so retargeting is disabled by default, with a knob to +enable it. + +Overload retargeting significantly increases availability during overload, but it does increase the risk of getting +stale data when used with `primaryPreferred`. Users of `primaryPreferred` may widely end up preferring that behavior. If +that is the case, overload retargeting may be enabled by default in the future. + +`secondaryPreferred` does not have this same staleness issue, but it still materially changes what the preference means +from "almost always secondary" to "sometimes primary". + ## Changelog +- 2026-03-30: Introduce phase 1 support without token buckets. + - 2026-02-20: Disable token buckets by default. - 2026-01-09: Initial version. diff --git a/source/client-backpressure/tests/README.md b/source/client-backpressure/tests/README.md index 2790716bf8..24aea3d33b 100644 --- a/source/client-backpressure/tests/README.md +++ b/source/client-backpressure/tests/README.md @@ -14,7 +14,8 @@ be manually implemented by each driver. #### Test 1: Operation Retry Uses Exponential Backoff -Drivers should test that retries do not occur immediately when a SystemOverloadedError is encountered. +Drivers should test that retries do not occur immediately when a SystemOverloadedError is encountered. This test MUST be +executed against a MongoDB 4.4+ server that has enabled the `configureFailPoint` command with the `errorLabels` option. 1. Let `client` be a `MongoClient` 2. Let `collection` be a collection @@ -49,29 +50,19 @@ Drivers should test that retries do not occur immediately when a SystemOverloade 5. Execute step 3 again. - 6. Compare the two time between the two runs. + 6. Compare the time between the two runs. ```python - assertTrue(with_backoff_time - no_backoff_time >= 2.1) + assertTrue(absolute_value(with_backoff_time - (no_backoff_time + 0.3 seconds)) < 0.3 seconds) ``` - The sum of 5 backoffs is 3.1 seconds. There is a 1-second window to account for potential variance between the two - runs. - -#### Test 2: Token Bucket Capacity is Enforced - -Drivers should test that retry token buckets are created at their maximum capacity and that that capacity is enforced. - -1. Let `client` be a `MongoClient` with `adaptiveRetries=True`. -2. Assert that the client's retry token bucket is at full capacity and that the capacity is - `DEFAULT_RETRY_TOKEN_CAPACITY`. -3. Using `client`, execute a successful `ping` command. -4. Assert that the successful command did not increase the number of tokens in the bucket above - `DEFAULT_RETRY_TOKEN_CAPACITY`. + The sum of 2 backoffs is 0.3 seconds. There is a 0.3-second window to account for potential variance between the + two runs. #### Test 3: Overload Errors are Retried a Maximum of MAX_RETRIES times -Drivers should test that without adaptive retries enabled, overload errors are retried a maximum of five times. +Drivers should test that overload errors are retried a maximum of MAX_RETRIES times. This test MUST be executed against +a MongoDB 4.4+ server that has enabled the `configureFailPoint` command with the `errorLabels` option. 1. Let `client` be a `MongoClient` with command event monitoring enabled. @@ -95,24 +86,24 @@ Drivers should test that without adaptive retries enabled, overload errors are r 5. Assert that the raised error contains both the `RetryableError` and `SystemOverloadedError` error labels. -6. Assert that the total number of started commands is MAX_RETRIES + 1 (6). +6. Assert that the total number of started commands is MAX_RETRIES + 1 (3). -#### Test 4: Adaptive Retries are Limited by Token Bucket Tokens +#### Test 4: Overload Errors are Retried a Maximum of maxAdaptiveRetries times when configured -Drivers should test that when enabled, adaptive retries are limited by the number of tokens in the bucket. +Drivers should test that overload errors are retried a maximum of `maxAdaptiveRetries` times, when configured. This test +MUST be executed against a MongoDB 4.4+ server that has enabled the `configureFailPoint` command with the `errorLabels` +option. -1. Let `client` be a `MongoClient` with `adaptiveRetries=True` and command event monitoring enabled. +1. Let `client` be a `MongoClient` with `maxAdaptiveRetries=1` and command event monitoring enabled. -2. Set `client`'s retry token bucket to have 2 tokens. - -3. Let `coll` be a collection. +2. Let `coll` be a collection. -4. Configure the following failpoint: +3. Configure the following failpoint: ```javascript { configureFailPoint: 'failCommand', - mode: {times: 3}, + mode: 'alwaysOn', data: { failCommands: ['find'], errorCode: 462, // IngressRequestRateLimitExceeded @@ -121,8 +112,8 @@ Drivers should test that when enabled, adaptive retries are limited by the numbe } ``` -5. Perform a find operation with `coll` that fails. +4. Perform a find operation with `coll` that fails. -6. Assert that the raised error contains both the `RetryableError` and `SystemOverloadedError` error labels. +5. Assert that the raised error contains both the `RetryableError` and `SystemOverloadedError` error labels. -7. Assert that the total number of started commands is 3: one for the initial attempt and two for the retries. +6. Assert that the total number of started commands is `maxAdaptiveRetries` + 1 (2). diff --git a/source/client-backpressure/tests/backpressure-connection-checkin.json b/source/client-backpressure/tests/backpressure-connection-checkin.json index 340c87c014..794951ad5f 100644 --- a/source/client-backpressure/tests/backpressure-connection-checkin.json +++ b/source/client-backpressure/tests/backpressure-connection-checkin.json @@ -85,24 +85,6 @@ "client": "client", "eventType": "cmap", "events": [ - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, { "connectionCheckedOutEvent": {} }, diff --git a/source/client-backpressure/tests/backpressure-connection-checkin.yml b/source/client-backpressure/tests/backpressure-connection-checkin.yml index 7c4359335c..ce8c1acb36 100644 --- a/source/client-backpressure/tests/backpressure-connection-checkin.yml +++ b/source/client-backpressure/tests/backpressure-connection-checkin.yml @@ -58,10 +58,3 @@ tests: - connectionCheckedInEvent: {} - connectionCheckedOutEvent: {} - connectionCheckedInEvent: {} - - connectionCheckedOutEvent: {} - - connectionCheckedInEvent: {} - - connectionCheckedOutEvent: {} - - connectionCheckedInEvent: {} - - connectionCheckedOutEvent: {} - - connectionCheckedInEvent: {} - diff --git a/source/client-backpressure/tests/backpressure-retry-loop.json b/source/client-backpressure/tests/backpressure-retry-loop.json index 9121b21856..a0b4877fac 100644 --- a/source/client-backpressure/tests/backpressure-retry-loop.json +++ b/source/client-backpressure/tests/backpressure-retry-loop.json @@ -145,7 +145,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -197,16 +197,6 @@ "commandName": "listDatabases" } }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, { "commandSucceededEvent": { "commandName": "listDatabases" @@ -283,7 +273,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -332,16 +322,6 @@ "commandName": "listDatabases" } }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, { "commandSucceededEvent": { "commandName": "listDatabases" @@ -415,7 +395,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -467,16 +447,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" @@ -558,7 +528,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -620,16 +590,6 @@ "commandName": "bulkWrite" } }, - { - "commandFailedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, { "commandSucceededEvent": { "commandName": "bulkWrite" @@ -721,7 +681,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -780,16 +740,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" @@ -873,7 +823,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -925,16 +875,6 @@ "commandName": "listCollections" } }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, { "commandSucceededEvent": { "commandName": "listCollections" @@ -1011,7 +951,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1063,16 +1003,6 @@ "commandName": "listCollections" } }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, { "commandSucceededEvent": { "commandName": "listCollections" @@ -1149,7 +1079,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1204,16 +1134,6 @@ "commandName": "ping" } }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "ping" - } - }, { "commandSucceededEvent": { "commandName": "ping" @@ -1352,7 +1272,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1404,16 +1324,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" @@ -1490,7 +1400,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1542,16 +1452,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" @@ -1628,7 +1528,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1680,16 +1580,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" @@ -1766,7 +1656,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1815,16 +1705,6 @@ "commandName": "count" } }, - { - "commandFailedEvent": { - "commandName": "count" - } - }, - { - "commandStartedEvent": { - "commandName": "count" - } - }, { "commandSucceededEvent": { "commandName": "count" @@ -1898,7 +1778,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -1951,16 +1831,6 @@ "commandName": "distinct" } }, - { - "commandFailedEvent": { - "commandName": "distinct" - } - }, - { - "commandStartedEvent": { - "commandName": "distinct" - } - }, { "commandSucceededEvent": { "commandName": "distinct" @@ -2038,7 +1908,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2090,16 +1960,6 @@ "commandName": "find" } }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, { "commandSucceededEvent": { "commandName": "find" @@ -2176,7 +2036,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2228,16 +2088,6 @@ "commandName": "find" } }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, { "commandSucceededEvent": { "commandName": "find" @@ -2314,7 +2164,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2363,16 +2213,6 @@ "commandName": "listIndexes" } }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, { "commandSucceededEvent": { "commandName": "listIndexes" @@ -2446,7 +2286,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2495,16 +2335,6 @@ "commandName": "listIndexes" } }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, { "commandSucceededEvent": { "commandName": "listIndexes" @@ -2578,7 +2408,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2630,16 +2460,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" @@ -2716,7 +2536,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2771,16 +2591,6 @@ "commandName": "insert" } }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, { "commandSucceededEvent": { "commandName": "insert" @@ -2860,7 +2670,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -2917,16 +2727,6 @@ "commandName": "insert" } }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, { "commandSucceededEvent": { "commandName": "insert" @@ -3008,7 +2808,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3060,16 +2860,6 @@ "commandName": "delete" } }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, { "commandSucceededEvent": { "commandName": "delete" @@ -3146,7 +2936,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3198,16 +2988,6 @@ "commandName": "delete" } }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, { "commandSucceededEvent": { "commandName": "delete" @@ -3284,7 +3064,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3339,16 +3119,6 @@ "commandName": "update" } }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, { "commandSucceededEvent": { "commandName": "update" @@ -3428,7 +3198,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3485,16 +3255,6 @@ "commandName": "update" } }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, { "commandSucceededEvent": { "commandName": "update" @@ -3576,7 +3336,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3633,16 +3393,6 @@ "commandName": "update" } }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, { "commandSucceededEvent": { "commandName": "update" @@ -3724,7 +3474,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3776,16 +3526,6 @@ "commandName": "findAndModify" } }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, { "commandSucceededEvent": { "commandName": "findAndModify" @@ -3862,7 +3602,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -3917,16 +3657,6 @@ "commandName": "findAndModify" } }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, { "commandSucceededEvent": { "commandName": "findAndModify" @@ -4006,7 +3736,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -4063,16 +3793,6 @@ "commandName": "findAndModify" } }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, { "commandSucceededEvent": { "commandName": "findAndModify" @@ -4154,7 +3874,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -4215,16 +3935,6 @@ "commandName": "insert" } }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, { "commandSucceededEvent": { "commandName": "insert" @@ -4310,7 +4020,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -4365,16 +4075,6 @@ "commandName": "createIndexes" } }, - { - "commandFailedEvent": { - "commandName": "createIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "createIndexes" - } - }, { "commandSucceededEvent": { "commandName": "createIndexes" @@ -4464,7 +4164,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -4516,16 +4216,6 @@ "commandName": "dropIndexes" } }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, { "commandSucceededEvent": { "commandName": "dropIndexes" @@ -4612,7 +4302,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -4661,16 +4351,6 @@ "commandName": "dropIndexes" } }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, { "commandSucceededEvent": { "commandName": "dropIndexes" @@ -4744,7 +4424,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -4800,16 +4480,6 @@ "commandName": "aggregate" } }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, { "commandSucceededEvent": { "commandName": "aggregate" diff --git a/source/client-backpressure/tests/backpressure-retry-loop.yml b/source/client-backpressure/tests/backpressure-retry-loop.yml index 5b1f064641..902726f626 100644 --- a/source/client-backpressure/tests/backpressure-retry-loop.yml +++ b/source/client-backpressure/tests/backpressure-retry-loop.yml @@ -92,7 +92,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [listDatabases] errorLabels: [RetryableError, SystemOverloadedError] @@ -116,10 +116,6 @@ tests: commandName: listDatabases - commandStartedEvent: commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases - - commandStartedEvent: - commandName: listDatabases - commandSucceededEvent: commandName: listDatabases - description: 'client.listDatabases (read) does not retry if retryReads=false' @@ -161,7 +157,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [listDatabases] errorLabels: [RetryableError, SystemOverloadedError] @@ -183,10 +179,6 @@ tests: commandName: listDatabases - commandStartedEvent: commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases - - commandStartedEvent: - commandName: listDatabases - commandSucceededEvent: commandName: listDatabases - description: 'client.listDatabaseNames (read) does not retry if retryReads=false' @@ -226,7 +218,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -250,10 +242,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'client.createChangeStream (read) does not retry if retryReads=false' @@ -297,7 +285,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [bulkWrite] errorLabels: [RetryableError, SystemOverloadedError] @@ -324,10 +312,6 @@ tests: commandName: bulkWrite - commandStartedEvent: commandName: bulkWrite - - commandFailedEvent: - commandName: bulkWrite - - commandStartedEvent: - commandName: bulkWrite - commandSucceededEvent: commandName: bulkWrite - description: 'client.clientBulkWrite (write) does not retry if retryWrites=false' @@ -374,7 +358,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -398,10 +382,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'database.aggregate (read) does not retry if retryReads=false' @@ -443,7 +423,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [listCollections] errorLabels: [RetryableError, SystemOverloadedError] @@ -467,10 +447,6 @@ tests: commandName: listCollections - commandStartedEvent: commandName: listCollections - - commandFailedEvent: - commandName: listCollections - - commandStartedEvent: - commandName: listCollections - commandSucceededEvent: commandName: listCollections - description: 'database.listCollections (read) does not retry if retryReads=false' @@ -512,7 +488,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [listCollections] errorLabels: [RetryableError, SystemOverloadedError] @@ -536,10 +512,6 @@ tests: commandName: listCollections - commandStartedEvent: commandName: listCollections - - commandFailedEvent: - commandName: listCollections - - commandStartedEvent: - commandName: listCollections - commandSucceededEvent: commandName: listCollections - description: 'database.listCollectionNames (read) does not retry if retryReads=false' @@ -581,7 +553,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [ping] errorLabels: [RetryableError, SystemOverloadedError] @@ -606,10 +578,6 @@ tests: commandName: ping - commandStartedEvent: commandName: ping - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: ping - commandSucceededEvent: commandName: ping - description: 'database.runCommand (read) does not retry if retryReads=false' @@ -682,7 +650,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -706,10 +674,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'database.createChangeStream (read) does not retry if retryReads=false' @@ -751,7 +715,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -775,10 +739,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'collection.aggregate (read) does not retry if retryReads=false' @@ -820,7 +780,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -844,10 +804,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'collection.countDocuments (read) does not retry if retryReads=false' @@ -889,7 +845,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [count] errorLabels: [RetryableError, SystemOverloadedError] @@ -911,10 +867,6 @@ tests: commandName: count - commandStartedEvent: commandName: count - - commandFailedEvent: - commandName: count - - commandStartedEvent: - commandName: count - commandSucceededEvent: commandName: count - description: 'collection.estimatedDocumentCount (read) does not retry if retryReads=false' @@ -954,7 +906,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [distinct] errorLabels: [RetryableError, SystemOverloadedError] @@ -979,10 +931,6 @@ tests: commandName: distinct - commandStartedEvent: commandName: distinct - - commandFailedEvent: - commandName: distinct - - commandStartedEvent: - commandName: distinct - commandSucceededEvent: commandName: distinct - description: 'collection.distinct (read) does not retry if retryReads=false' @@ -1025,7 +973,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [find] errorLabels: [RetryableError, SystemOverloadedError] @@ -1049,10 +997,6 @@ tests: commandName: find - commandStartedEvent: commandName: find - - commandFailedEvent: - commandName: find - - commandStartedEvent: - commandName: find - commandSucceededEvent: commandName: find - description: 'collection.find (read) does not retry if retryReads=false' @@ -1094,7 +1038,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [find] errorLabels: [RetryableError, SystemOverloadedError] @@ -1118,10 +1062,6 @@ tests: commandName: find - commandStartedEvent: commandName: find - - commandFailedEvent: - commandName: find - - commandStartedEvent: - commandName: find - commandSucceededEvent: commandName: find - description: 'collection.findOne (read) does not retry if retryReads=false' @@ -1163,7 +1103,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [listIndexes] errorLabels: [RetryableError, SystemOverloadedError] @@ -1185,10 +1125,6 @@ tests: commandName: listIndexes - commandStartedEvent: commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes - - commandStartedEvent: - commandName: listIndexes - commandSucceededEvent: commandName: listIndexes - description: 'collection.listIndexes (read) does not retry if retryReads=false' @@ -1228,7 +1164,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [listIndexes] errorLabels: [RetryableError, SystemOverloadedError] @@ -1250,10 +1186,6 @@ tests: commandName: listIndexes - commandStartedEvent: commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes - - commandStartedEvent: - commandName: listIndexes - commandSucceededEvent: commandName: listIndexes - description: 'collection.listIndexNames (read) does not retry if retryReads=false' @@ -1293,7 +1225,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -1317,10 +1249,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'collection.createChangeStream (read) does not retry if retryReads=false' @@ -1362,7 +1290,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [insert] errorLabels: [RetryableError, SystemOverloadedError] @@ -1386,10 +1314,6 @@ tests: commandName: insert - commandStartedEvent: commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - commandSucceededEvent: commandName: insert - description: 'collection.insertOne (write) does not retry if retryWrites=false' @@ -1431,7 +1355,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [insert] errorLabels: [RetryableError, SystemOverloadedError] @@ -1456,10 +1380,6 @@ tests: commandName: insert - commandStartedEvent: commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - commandSucceededEvent: commandName: insert - description: 'collection.insertMany (write) does not retry if retryWrites=false' @@ -1502,7 +1422,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [delete] errorLabels: [RetryableError, SystemOverloadedError] @@ -1526,10 +1446,6 @@ tests: commandName: delete - commandStartedEvent: commandName: delete - - commandFailedEvent: - commandName: delete - - commandStartedEvent: - commandName: delete - commandSucceededEvent: commandName: delete - description: 'collection.deleteOne (write) does not retry if retryWrites=false' @@ -1571,7 +1487,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [delete] errorLabels: [RetryableError, SystemOverloadedError] @@ -1595,10 +1511,6 @@ tests: commandName: delete - commandStartedEvent: commandName: delete - - commandFailedEvent: - commandName: delete - - commandStartedEvent: - commandName: delete - commandSucceededEvent: commandName: delete - description: 'collection.deleteMany (write) does not retry if retryWrites=false' @@ -1640,7 +1552,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [update] errorLabels: [RetryableError, SystemOverloadedError] @@ -1665,10 +1577,6 @@ tests: commandName: update - commandStartedEvent: commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - commandSucceededEvent: commandName: update - description: 'collection.replaceOne (write) does not retry if retryWrites=false' @@ -1711,7 +1619,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [update] errorLabels: [RetryableError, SystemOverloadedError] @@ -1736,10 +1644,6 @@ tests: commandName: update - commandStartedEvent: commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - commandSucceededEvent: commandName: update - description: 'collection.updateOne (write) does not retry if retryWrites=false' @@ -1782,7 +1686,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [update] errorLabels: [RetryableError, SystemOverloadedError] @@ -1807,10 +1711,6 @@ tests: commandName: update - commandStartedEvent: commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - commandSucceededEvent: commandName: update - description: 'collection.updateMany (write) does not retry if retryWrites=false' @@ -1853,7 +1753,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [findAndModify] errorLabels: [RetryableError, SystemOverloadedError] @@ -1877,10 +1777,6 @@ tests: commandName: findAndModify - commandStartedEvent: commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - commandSucceededEvent: commandName: findAndModify - description: 'collection.findOneAndDelete (write) does not retry if retryWrites=false' @@ -1922,7 +1818,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [findAndModify] errorLabels: [RetryableError, SystemOverloadedError] @@ -1947,10 +1843,6 @@ tests: commandName: findAndModify - commandStartedEvent: commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - commandSucceededEvent: commandName: findAndModify - description: 'collection.findOneAndReplace (write) does not retry if retryWrites=false' @@ -1993,7 +1885,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [findAndModify] errorLabels: [RetryableError, SystemOverloadedError] @@ -2018,10 +1910,6 @@ tests: commandName: findAndModify - commandStartedEvent: commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - commandSucceededEvent: commandName: findAndModify - description: 'collection.findOneAndUpdate (write) does not retry if retryWrites=false' @@ -2064,7 +1952,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [insert] errorLabels: [RetryableError, SystemOverloadedError] @@ -2090,10 +1978,6 @@ tests: commandName: insert - commandStartedEvent: commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - commandSucceededEvent: commandName: insert - description: 'collection.bulkWrite (write) does not retry if retryWrites=false' @@ -2137,7 +2021,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [createIndexes] errorLabels: [RetryableError, SystemOverloadedError] @@ -2162,10 +2046,6 @@ tests: commandName: createIndexes - commandStartedEvent: commandName: createIndexes - - commandFailedEvent: - commandName: createIndexes - - commandStartedEvent: - commandName: createIndexes - commandSucceededEvent: commandName: createIndexes - description: 'collection.createIndex (write) does not retry if retryWrites=false' @@ -2213,7 +2093,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [dropIndexes] errorLabels: [RetryableError, SystemOverloadedError] @@ -2237,10 +2117,6 @@ tests: commandName: dropIndexes - commandStartedEvent: commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes - - commandStartedEvent: - commandName: dropIndexes - commandSucceededEvent: commandName: dropIndexes - description: 'collection.dropIndex (write) does not retry if retryWrites=false' @@ -2287,7 +2163,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [dropIndexes] errorLabels: [RetryableError, SystemOverloadedError] @@ -2309,10 +2185,6 @@ tests: commandName: dropIndexes - commandStartedEvent: commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes - - commandStartedEvent: - commandName: dropIndexes - commandSucceededEvent: commandName: dropIndexes - description: 'collection.dropIndexes (write) does not retry if retryWrites=false' @@ -2352,7 +2224,7 @@ tests: client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [aggregate] errorLabels: [RetryableError, SystemOverloadedError] @@ -2376,10 +2248,6 @@ tests: commandName: aggregate - commandStartedEvent: commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - commandSucceededEvent: commandName: aggregate - description: 'collection.aggregate (write) does not retry if retryWrites=false' diff --git a/source/client-backpressure/tests/backpressure-retry-loop.yml.template b/source/client-backpressure/tests/backpressure-retry-loop.yml.template index 3504c5d157..1825b2b20d 100644 --- a/source/client-backpressure/tests/backpressure-retry-loop.yml.template +++ b/source/client-backpressure/tests/backpressure-retry-loop.yml.template @@ -101,7 +101,7 @@ tests: {% for operation in operations %} client: *internal_client failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [{{operation.command_name}}] errorLabels: [RetryableError, SystemOverloadedError] @@ -129,10 +129,6 @@ tests: {% for operation in operations %} commandName: {{operation.command_name}} - commandStartedEvent: commandName: {{operation.command_name}} - - commandFailedEvent: - commandName: {{operation.command_name}} - - commandStartedEvent: - commandName: {{operation.command_name}} - commandSucceededEvent: commandName: {{operation.command_name}} diff --git a/source/client-backpressure/tests/backpressure-retry-max-attempts.json b/source/client-backpressure/tests/backpressure-retry-max-attempts.json index ed2352ca83..de52572765 100644 --- a/source/client-backpressure/tests/backpressure-retry-max-attempts.json +++ b/source/client-backpressure/tests/backpressure-retry-max-attempts.json @@ -1,5 +1,5 @@ { - "description": "tests that operations retry at most maxAttempts=5 times", + "description": "tests that operations retry at most maxAttempts=2 times", "schemaVersion": "1.3", "runOnRequirements": [ { @@ -68,7 +68,7 @@ ], "tests": [ { - "description": "client.listDatabases retries at most maxAttempts=5 times", + "description": "client.listDatabases retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -107,36 +107,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, { "commandStartedEvent": { "commandName": "listDatabases" @@ -172,7 +142,7 @@ ] }, { - "description": "client.listDatabaseNames retries at most maxAttempts=5 times", + "description": "client.listDatabaseNames retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -208,36 +178,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - }, { "commandStartedEvent": { "commandName": "listDatabases" @@ -273,7 +213,7 @@ ] }, { - "description": "client.createChangeStream retries at most maxAttempts=5 times", + "description": "client.createChangeStream retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -312,36 +252,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" @@ -377,7 +287,7 @@ ] }, { - "description": "client.clientBulkWrite retries at most maxAttempts=5 times", + "description": "client.clientBulkWrite retries at most maxAttempts=2 times", "runOnRequirements": [ { "minServerVersion": "8.0" @@ -431,36 +341,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandFailedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandFailedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandFailedEvent": { - "commandName": "bulkWrite" - } - }, { "commandStartedEvent": { "commandName": "bulkWrite" @@ -496,7 +376,7 @@ ] }, { - "description": "database.aggregate read retries at most maxAttempts=5 times", + "description": "database.aggregate read retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -542,36 +422,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" @@ -607,7 +457,7 @@ ] }, { - "description": "database.listCollections retries at most maxAttempts=5 times", + "description": "database.listCollections retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -646,36 +496,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, { "commandStartedEvent": { "commandName": "listCollections" @@ -711,7 +531,7 @@ ] }, { - "description": "database.listCollectionNames retries at most maxAttempts=5 times", + "description": "database.listCollectionNames retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -750,36 +570,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - }, { "commandStartedEvent": { "commandName": "listCollections" @@ -815,7 +605,7 @@ ] }, { - "description": "database.runCommand retries at most maxAttempts=5 times", + "description": "database.runCommand retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -857,36 +647,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "ping" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "ping" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "ping" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, { "commandStartedEvent": { "commandName": "ping" @@ -922,7 +682,7 @@ ] }, { - "description": "database.createChangeStream retries at most maxAttempts=5 times", + "description": "database.createChangeStream retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -961,36 +721,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" @@ -1026,7 +756,7 @@ ] }, { - "description": "collection.aggregate read retries at most maxAttempts=5 times", + "description": "collection.aggregate read retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1065,36 +795,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" @@ -1130,7 +830,7 @@ ] }, { - "description": "collection.countDocuments retries at most maxAttempts=5 times", + "description": "collection.countDocuments retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1169,36 +869,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" @@ -1234,7 +904,7 @@ ] }, { - "description": "collection.estimatedDocumentCount retries at most maxAttempts=5 times", + "description": "collection.estimatedDocumentCount retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1270,36 +940,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "count" - } - }, - { - "commandFailedEvent": { - "commandName": "count" - } - }, - { - "commandStartedEvent": { - "commandName": "count" - } - }, - { - "commandFailedEvent": { - "commandName": "count" - } - }, - { - "commandStartedEvent": { - "commandName": "count" - } - }, - { - "commandFailedEvent": { - "commandName": "count" - } - }, { "commandStartedEvent": { "commandName": "count" @@ -1335,7 +975,7 @@ ] }, { - "description": "collection.distinct retries at most maxAttempts=5 times", + "description": "collection.distinct retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1375,36 +1015,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "distinct" - } - }, - { - "commandFailedEvent": { - "commandName": "distinct" - } - }, - { - "commandStartedEvent": { - "commandName": "distinct" - } - }, - { - "commandFailedEvent": { - "commandName": "distinct" - } - }, - { - "commandStartedEvent": { - "commandName": "distinct" - } - }, - { - "commandFailedEvent": { - "commandName": "distinct" - } - }, { "commandStartedEvent": { "commandName": "distinct" @@ -1440,7 +1050,7 @@ ] }, { - "description": "collection.find retries at most maxAttempts=5 times", + "description": "collection.find retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1479,36 +1089,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, { "commandStartedEvent": { "commandName": "find" @@ -1544,7 +1124,7 @@ ] }, { - "description": "collection.findOne retries at most maxAttempts=5 times", + "description": "collection.findOne retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1583,36 +1163,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, { "commandStartedEvent": { "commandName": "find" @@ -1648,7 +1198,7 @@ ] }, { - "description": "collection.listIndexes retries at most maxAttempts=5 times", + "description": "collection.listIndexes retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1684,36 +1234,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, { "commandStartedEvent": { "commandName": "listIndexes" @@ -1749,7 +1269,7 @@ ] }, { - "description": "collection.listIndexNames retries at most maxAttempts=5 times", + "description": "collection.listIndexNames retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1785,36 +1305,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - }, { "commandStartedEvent": { "commandName": "listIndexes" @@ -1850,7 +1340,7 @@ ] }, { - "description": "collection.createChangeStream retries at most maxAttempts=5 times", + "description": "collection.createChangeStream retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1889,36 +1379,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" @@ -1954,7 +1414,7 @@ ] }, { - "description": "collection.insertOne retries at most maxAttempts=5 times", + "description": "collection.insertOne retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -1996,36 +1456,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, { "commandStartedEvent": { "commandName": "insert" @@ -2061,7 +1491,7 @@ ] }, { - "description": "collection.insertMany retries at most maxAttempts=5 times", + "description": "collection.insertMany retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2105,36 +1535,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, { "commandStartedEvent": { "commandName": "insert" @@ -2170,7 +1570,7 @@ ] }, { - "description": "collection.deleteOne retries at most maxAttempts=5 times", + "description": "collection.deleteOne retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2209,36 +1609,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, { "commandStartedEvent": { "commandName": "delete" @@ -2274,7 +1644,7 @@ ] }, { - "description": "collection.deleteMany retries at most maxAttempts=5 times", + "description": "collection.deleteMany retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2313,36 +1683,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - }, { "commandStartedEvent": { "commandName": "delete" @@ -2378,7 +1718,7 @@ ] }, { - "description": "collection.replaceOne retries at most maxAttempts=5 times", + "description": "collection.replaceOne retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2420,36 +1760,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, { "commandStartedEvent": { "commandName": "update" @@ -2485,7 +1795,7 @@ ] }, { - "description": "collection.updateOne retries at most maxAttempts=5 times", + "description": "collection.updateOne retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2529,36 +1839,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, { "commandStartedEvent": { "commandName": "update" @@ -2594,7 +1874,7 @@ ] }, { - "description": "collection.updateMany retries at most maxAttempts=5 times", + "description": "collection.updateMany retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2622,52 +1902,22 @@ "object": "collection", "arguments": { "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" + "update": { + "$set": { + "x": 22 } - }, + } + }, + "expectError": { + "isError": true, + "isClientError": false + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ { "commandStartedEvent": { "commandName": "update" @@ -2703,7 +1953,7 @@ ] }, { - "description": "collection.findOneAndDelete retries at most maxAttempts=5 times", + "description": "collection.findOneAndDelete retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2742,36 +1992,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, { "commandStartedEvent": { "commandName": "findAndModify" @@ -2807,7 +2027,7 @@ ] }, { - "description": "collection.findOneAndReplace retries at most maxAttempts=5 times", + "description": "collection.findOneAndReplace retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2849,36 +2069,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, { "commandStartedEvent": { "commandName": "findAndModify" @@ -2914,7 +2104,7 @@ ] }, { - "description": "collection.findOneAndUpdate retries at most maxAttempts=5 times", + "description": "collection.findOneAndUpdate retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -2958,36 +2148,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - }, { "commandStartedEvent": { "commandName": "findAndModify" @@ -3023,7 +2183,7 @@ ] }, { - "description": "collection.bulkWrite retries at most maxAttempts=5 times", + "description": "collection.bulkWrite retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -3071,36 +2231,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, { "commandStartedEvent": { "commandName": "insert" @@ -3136,7 +2266,7 @@ ] }, { - "description": "collection.createIndex retries at most maxAttempts=5 times", + "description": "collection.createIndex retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -3178,36 +2308,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "createIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "createIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "createIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "createIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "createIndexes" - } - }, { "commandStartedEvent": { "commandName": "createIndexes" @@ -3243,7 +2343,7 @@ ] }, { - "description": "collection.dropIndex retries at most maxAttempts=5 times", + "description": "collection.dropIndex retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -3282,36 +2382,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, { "commandStartedEvent": { "commandName": "dropIndexes" @@ -3347,7 +2417,7 @@ ] }, { - "description": "collection.dropIndexes retries at most maxAttempts=5 times", + "description": "collection.dropIndexes retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -3383,36 +2453,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandStartedEvent": { - "commandName": "dropIndexes" - } - }, - { - "commandFailedEvent": { - "commandName": "dropIndexes" - } - }, { "commandStartedEvent": { "commandName": "dropIndexes" @@ -3448,7 +2488,7 @@ ] }, { - "description": "collection.aggregate write retries at most maxAttempts=5 times", + "description": "collection.aggregate write retries at most maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -3491,36 +2531,6 @@ { "client": "client", "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - }, { "commandStartedEvent": { "commandName": "aggregate" diff --git a/source/client-backpressure/tests/backpressure-retry-max-attempts.yml b/source/client-backpressure/tests/backpressure-retry-max-attempts.yml index 36be3fb8f5..eec89671fa 100644 --- a/source/client-backpressure/tests/backpressure-retry-max-attempts.yml +++ b/source/client-backpressure/tests/backpressure-retry-max-attempts.yml @@ -1,6 +1,6 @@ # Tests in this file are generated from backpressure-retry-max-attempts.yml.template. -description: tests that operations retry at most maxAttempts=5 times +description: tests that operations retry at most maxAttempts=2 times schemaVersion: '1.3' @@ -41,7 +41,7 @@ initialData: - { _id: 2, x: 22 } tests: - - description: 'client.listDatabases retries at most maxAttempts=5 times' + - description: 'client.listDatabases retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -66,20 +66,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases - - commandStartedEvent: - commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases - - commandStartedEvent: - commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: listDatabases - commandFailedEvent: @@ -93,7 +81,7 @@ tests: - commandFailedEvent: commandName: listDatabases - - description: 'client.listDatabaseNames retries at most maxAttempts=5 times' + - description: 'client.listDatabaseNames retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -116,20 +104,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases - - commandStartedEvent: - commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases - - commandStartedEvent: - commandName: listDatabases - - commandFailedEvent: - commandName: listDatabases + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: listDatabases - commandFailedEvent: @@ -143,7 +119,7 @@ tests: - commandFailedEvent: commandName: listDatabases - - description: 'client.createChangeStream retries at most maxAttempts=5 times' + - description: 'client.createChangeStream retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -168,20 +144,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: @@ -195,7 +159,7 @@ tests: - commandFailedEvent: commandName: aggregate - - description: 'client.clientBulkWrite retries at most maxAttempts=5 times' + - description: 'client.clientBulkWrite retries at most maxAttempts=2 times' runOnRequirements: - minServerVersion: '8.0' # client bulk write added to server in 8.0 operations: @@ -225,20 +189,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: bulkWrite - - commandFailedEvent: - commandName: bulkWrite - - commandStartedEvent: - commandName: bulkWrite - - commandFailedEvent: - commandName: bulkWrite - - commandStartedEvent: - commandName: bulkWrite - - commandFailedEvent: - commandName: bulkWrite + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: bulkWrite - commandFailedEvent: @@ -252,7 +204,7 @@ tests: - commandFailedEvent: commandName: bulkWrite - - description: 'database.aggregate read retries at most maxAttempts=5 times' + - description: 'database.aggregate read retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -277,20 +229,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: @@ -304,7 +244,7 @@ tests: - commandFailedEvent: commandName: aggregate - - description: 'database.listCollections retries at most maxAttempts=5 times' + - description: 'database.listCollections retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -329,20 +269,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: listCollections - - commandFailedEvent: - commandName: listCollections - - commandStartedEvent: - commandName: listCollections - - commandFailedEvent: - commandName: listCollections - - commandStartedEvent: - commandName: listCollections - - commandFailedEvent: - commandName: listCollections + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: listCollections - commandFailedEvent: @@ -356,7 +284,7 @@ tests: - commandFailedEvent: commandName: listCollections - - description: 'database.listCollectionNames retries at most maxAttempts=5 times' + - description: 'database.listCollectionNames retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -381,20 +309,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: listCollections - - commandFailedEvent: - commandName: listCollections - - commandStartedEvent: - commandName: listCollections - - commandFailedEvent: - commandName: listCollections - - commandStartedEvent: - commandName: listCollections - - commandFailedEvent: - commandName: listCollections + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: listCollections - commandFailedEvent: @@ -408,7 +324,7 @@ tests: - commandFailedEvent: commandName: listCollections - - description: 'database.runCommand retries at most maxAttempts=5 times' + - description: 'database.runCommand retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -434,20 +350,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: ping - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: ping - - commandFailedEvent: - commandName: ping - - commandStartedEvent: - commandName: ping - - commandFailedEvent: - commandName: ping + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: ping - commandFailedEvent: @@ -461,7 +365,7 @@ tests: - commandFailedEvent: commandName: ping - - description: 'database.createChangeStream retries at most maxAttempts=5 times' + - description: 'database.createChangeStream retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -486,20 +390,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: @@ -513,7 +405,7 @@ tests: - commandFailedEvent: commandName: aggregate - - description: 'collection.aggregate read retries at most maxAttempts=5 times' + - description: 'collection.aggregate read retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -538,20 +430,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: @@ -565,7 +445,7 @@ tests: - commandFailedEvent: commandName: aggregate - - description: 'collection.countDocuments retries at most maxAttempts=5 times' + - description: 'collection.countDocuments retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -590,20 +470,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: @@ -617,7 +485,7 @@ tests: - commandFailedEvent: commandName: aggregate - - description: 'collection.estimatedDocumentCount retries at most maxAttempts=5 times' + - description: 'collection.estimatedDocumentCount retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -640,20 +508,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: count - - commandFailedEvent: - commandName: count - - commandStartedEvent: - commandName: count - - commandFailedEvent: - commandName: count - - commandStartedEvent: - commandName: count - - commandFailedEvent: - commandName: count + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: count - commandFailedEvent: @@ -667,7 +523,7 @@ tests: - commandFailedEvent: commandName: count - - description: 'collection.distinct retries at most maxAttempts=5 times' + - description: 'collection.distinct retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -693,20 +549,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: distinct - - commandFailedEvent: - commandName: distinct - - commandStartedEvent: - commandName: distinct - - commandFailedEvent: - commandName: distinct - - commandStartedEvent: - commandName: distinct - - commandFailedEvent: - commandName: distinct + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: distinct - commandFailedEvent: @@ -720,7 +564,7 @@ tests: - commandFailedEvent: commandName: distinct - - description: 'collection.find retries at most maxAttempts=5 times' + - description: 'collection.find retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -745,20 +589,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: find - - commandFailedEvent: - commandName: find - - commandStartedEvent: - commandName: find - - commandFailedEvent: - commandName: find - - commandStartedEvent: - commandName: find - - commandFailedEvent: - commandName: find + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: find - commandFailedEvent: @@ -772,7 +604,7 @@ tests: - commandFailedEvent: commandName: find - - description: 'collection.findOne retries at most maxAttempts=5 times' + - description: 'collection.findOne retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -797,20 +629,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: find - - commandFailedEvent: - commandName: find - - commandStartedEvent: - commandName: find - - commandFailedEvent: - commandName: find - - commandStartedEvent: - commandName: find - - commandFailedEvent: - commandName: find + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: find - commandFailedEvent: @@ -824,7 +644,7 @@ tests: - commandFailedEvent: commandName: find - - description: 'collection.listIndexes retries at most maxAttempts=5 times' + - description: 'collection.listIndexes retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -847,20 +667,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes - - commandStartedEvent: - commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes - - commandStartedEvent: - commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: listIndexes - commandFailedEvent: @@ -874,7 +682,7 @@ tests: - commandFailedEvent: commandName: listIndexes - - description: 'collection.listIndexNames retries at most maxAttempts=5 times' + - description: 'collection.listIndexNames retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -897,20 +705,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes - - commandStartedEvent: - commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes - - commandStartedEvent: - commandName: listIndexes - - commandFailedEvent: - commandName: listIndexes + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: listIndexes - commandFailedEvent: @@ -924,7 +720,7 @@ tests: - commandFailedEvent: commandName: listIndexes - - description: 'collection.createChangeStream retries at most maxAttempts=5 times' + - description: 'collection.createChangeStream retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -949,20 +745,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: @@ -976,7 +760,7 @@ tests: - commandFailedEvent: commandName: aggregate - - description: 'collection.insertOne retries at most maxAttempts=5 times' + - description: 'collection.insertOne retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1001,20 +785,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: insert - commandFailedEvent: @@ -1028,7 +800,7 @@ tests: - commandFailedEvent: commandName: insert - - description: 'collection.insertMany retries at most maxAttempts=5 times' + - description: 'collection.insertMany retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1054,20 +826,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: insert - commandFailedEvent: @@ -1081,7 +841,7 @@ tests: - commandFailedEvent: commandName: insert - - description: 'collection.deleteOne retries at most maxAttempts=5 times' + - description: 'collection.deleteOne retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1106,20 +866,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: delete - - commandFailedEvent: - commandName: delete - - commandStartedEvent: - commandName: delete - - commandFailedEvent: - commandName: delete - - commandStartedEvent: - commandName: delete - - commandFailedEvent: - commandName: delete + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: delete - commandFailedEvent: @@ -1133,7 +881,7 @@ tests: - commandFailedEvent: commandName: delete - - description: 'collection.deleteMany retries at most maxAttempts=5 times' + - description: 'collection.deleteMany retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1158,20 +906,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: delete - - commandFailedEvent: - commandName: delete - - commandStartedEvent: - commandName: delete - - commandFailedEvent: - commandName: delete - - commandStartedEvent: - commandName: delete - - commandFailedEvent: - commandName: delete + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: delete - commandFailedEvent: @@ -1185,7 +921,7 @@ tests: - commandFailedEvent: commandName: delete - - description: 'collection.replaceOne retries at most maxAttempts=5 times' + - description: 'collection.replaceOne retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1211,20 +947,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: update - commandFailedEvent: @@ -1238,7 +962,7 @@ tests: - commandFailedEvent: commandName: update - - description: 'collection.updateOne retries at most maxAttempts=5 times' + - description: 'collection.updateOne retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1264,20 +988,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: update - commandFailedEvent: @@ -1291,7 +1003,7 @@ tests: - commandFailedEvent: commandName: update - - description: 'collection.updateMany retries at most maxAttempts=5 times' + - description: 'collection.updateMany retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1317,20 +1029,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update - - commandStartedEvent: - commandName: update - - commandFailedEvent: - commandName: update + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: update - commandFailedEvent: @@ -1344,7 +1044,7 @@ tests: - commandFailedEvent: commandName: update - - description: 'collection.findOneAndDelete retries at most maxAttempts=5 times' + - description: 'collection.findOneAndDelete retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1369,20 +1069,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: findAndModify - commandFailedEvent: @@ -1396,7 +1084,7 @@ tests: - commandFailedEvent: commandName: findAndModify - - description: 'collection.findOneAndReplace retries at most maxAttempts=5 times' + - description: 'collection.findOneAndReplace retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1422,20 +1110,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: findAndModify - commandFailedEvent: @@ -1449,7 +1125,7 @@ tests: - commandFailedEvent: commandName: findAndModify - - description: 'collection.findOneAndUpdate retries at most maxAttempts=5 times' + - description: 'collection.findOneAndUpdate retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1475,20 +1151,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify - - commandStartedEvent: - commandName: findAndModify - - commandFailedEvent: - commandName: findAndModify + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: findAndModify - commandFailedEvent: @@ -1502,7 +1166,7 @@ tests: - commandFailedEvent: commandName: findAndModify - - description: 'collection.bulkWrite retries at most maxAttempts=5 times' + - description: 'collection.bulkWrite retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1529,20 +1193,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandFailedEvent: - commandName: insert + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: insert - commandFailedEvent: @@ -1556,7 +1208,7 @@ tests: - commandFailedEvent: commandName: insert - - description: 'collection.createIndex retries at most maxAttempts=5 times' + - description: 'collection.createIndex retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1582,20 +1234,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: createIndexes - - commandFailedEvent: - commandName: createIndexes - - commandStartedEvent: - commandName: createIndexes - - commandFailedEvent: - commandName: createIndexes - - commandStartedEvent: - commandName: createIndexes - - commandFailedEvent: - commandName: createIndexes + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: createIndexes - commandFailedEvent: @@ -1609,7 +1249,7 @@ tests: - commandFailedEvent: commandName: createIndexes - - description: 'collection.dropIndex retries at most maxAttempts=5 times' + - description: 'collection.dropIndex retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1634,20 +1274,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes - - commandStartedEvent: - commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes - - commandStartedEvent: - commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: dropIndexes - commandFailedEvent: @@ -1661,7 +1289,7 @@ tests: - commandFailedEvent: commandName: dropIndexes - - description: 'collection.dropIndexes retries at most maxAttempts=5 times' + - description: 'collection.dropIndexes retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1684,20 +1312,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes - - commandStartedEvent: - commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes - - commandStartedEvent: - commandName: dropIndexes - - commandFailedEvent: - commandName: dropIndexes + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: dropIndexes - commandFailedEvent: @@ -1711,7 +1327,7 @@ tests: - commandFailedEvent: commandName: dropIndexes - - description: 'collection.aggregate write retries at most maxAttempts=5 times' + - description: 'collection.aggregate write retries at most maxAttempts=2 times' operations: - name: failPoint object: testRunner @@ -1736,20 +1352,8 @@ tests: expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate - - commandStartedEvent: - commandName: aggregate - - commandFailedEvent: - commandName: aggregate + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: aggregate - commandFailedEvent: diff --git a/source/client-backpressure/tests/backpressure-retry-max-attempts.yml.template b/source/client-backpressure/tests/backpressure-retry-max-attempts.yml.template index 5620e491df..ffbd08de9c 100644 --- a/source/client-backpressure/tests/backpressure-retry-max-attempts.yml.template +++ b/source/client-backpressure/tests/backpressure-retry-max-attempts.yml.template @@ -1,6 +1,6 @@ # Tests in this file are generated from backpressure-retry-max-attempts.yml.template. -description: tests that operations retry at most maxAttempts=5 times +description: tests that operations retry at most maxAttempts=2 times schemaVersion: '1.3' @@ -41,7 +41,7 @@ initialData: - { _id: 2, x: 22 } tests: {% for operation in operations %} - - description: '{{operation.object}}.{{operation.operation_name}}{{ " " + operation.operation_type + "" if operation.operation_name == "aggregate" else "" }} retries at most maxAttempts=5 times' + - description: '{{operation.object}}.{{operation.operation_name}}{{ " " + operation.operation_type + "" if operation.operation_name == "aggregate" else "" }} retries at most maxAttempts=2 times' {%- if ((operation.operation_name == 'clientBulkWrite')) %} runOnRequirements: - minServerVersion: '8.0' # client bulk write added to server in 8.0 @@ -73,20 +73,8 @@ tests: {% for operation in operations %} expectEvents: - client: *client events: - # we expect 6 pairs of command started and succeeded events: - # 1 initial attempt and 5 retries. - - commandStartedEvent: - commandName: {{operation.command_name}} - - commandFailedEvent: - commandName: {{operation.command_name}} - - commandStartedEvent: - commandName: {{operation.command_name}} - - commandFailedEvent: - commandName: {{operation.command_name}} - - commandStartedEvent: - commandName: {{operation.command_name}} - - commandFailedEvent: - commandName: {{operation.command_name}} + # we expect 3 pairs of command started and succeeded events: + # 1 initial attempt and 2 retries. - commandStartedEvent: commandName: {{operation.command_name}} - commandFailedEvent: diff --git a/source/client-backpressure/tests/getMore-retried.json b/source/client-backpressure/tests/getMore-retried.json index 5fd76be679..d7607d694b 100644 --- a/source/client-backpressure/tests/getMore-retried.json +++ b/source/client-backpressure/tests/getMore-retried.json @@ -68,7 +68,7 @@ "failPoint": { "configureFailPoint": "failCommand", "mode": { - "times": 3 + "times": 2 }, "data": { "failCommands": [ @@ -145,16 +145,6 @@ "commandName": "getMore" } }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "commandName": "getMore" - } - }, { "commandSucceededEvent": { "commandName": "getMore" @@ -165,7 +155,7 @@ ] }, { - "description": "getMores are retried maxAttempts=5 times", + "description": "getMores are retried maxAttempts=2 times", "operations": [ { "name": "failPoint", @@ -245,36 +235,6 @@ "commandName": "getMore" } }, - { - "commandStartedEvent": { - "commandName": "getMore" - } - }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "commandName": "getMore" - } - }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "commandName": "getMore" - } - }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - }, { "commandStartedEvent": { "commandName": "killCursors" diff --git a/source/client-backpressure/tests/getMore-retried.yml b/source/client-backpressure/tests/getMore-retried.yml index d7111f6e50..cd8198383a 100644 --- a/source/client-backpressure/tests/getMore-retried.yml +++ b/source/client-backpressure/tests/getMore-retried.yml @@ -38,7 +38,7 @@ tests: client: *failPointClient failPoint: configureFailPoint: failCommand - mode: { times: 3 } + mode: { times: 2 } data: failCommands: [getMore] errorLabels: [RetryableError, SystemOverloadedError] @@ -70,11 +70,6 @@ tests: - commandFailedEvent: commandName: getMore # second attempt - - commandStartedEvent: - commandName: getMore - - commandFailedEvent: - commandName: getMore - # third attempt - commandStartedEvent: commandName: getMore - commandFailedEvent: @@ -85,7 +80,7 @@ tests: - commandSucceededEvent: commandName: getMore - - description: "getMores are retried maxAttempts=5 times" + - description: "getMores are retried maxAttempts=2 times" operations: - name: failPoint object: testRunner @@ -126,21 +121,6 @@ tests: - commandFailedEvent: commandName: getMore # third attempt - - commandStartedEvent: - commandName: getMore - - commandFailedEvent: - commandName: getMore - # fourth attempt - - commandStartedEvent: - commandName: getMore - - commandFailedEvent: - commandName: getMore - # fifth attempt - - commandStartedEvent: - commandName: getMore - - commandFailedEvent: - commandName: getMore - # final attempt - commandStartedEvent: commandName: getMore - commandFailedEvent: diff --git a/source/retryable-reads/tests/README.md b/source/retryable-reads/tests/README.md index 694eaae0ad..84ba981c9d 100644 --- a/source/retryable-reads/tests/README.md +++ b/source/retryable-reads/tests/README.md @@ -127,13 +127,13 @@ This test MUST be executed against a sharded cluster that supports `retryReads=t These tests will be used to ensure drivers properly retry reads against a replica set. -#### 3.1 Retryable Reads Caused by Overload Errors Are Retried on a Different Replicaset Server When One is Available +#### 3.1 Retryable Reads Caused by Overload Errors Are Retried on a Different Replicaset Server When One is Available and enableOverloadRetargeting is enabled This test MUST be executed against a MongoDB 4.4+ replica set that has at least one secondary, supports `retryReads=true`, and has enabled the `configureFailPoint` command with the `errorLabels` option. -1. Create a client `client` with `retryReads=true`, `readPreference=primaryPreferred`, and command event monitoring - enabled. +1. Create a client `client` with `retryReads=true`, `readPreference=primaryPreferred`, `enableOverloadRetargeting=True`, + and command event monitoring enabled. 2. Configure the following fail point for `client`: @@ -187,8 +187,40 @@ This test MUST be executed against a MongoDB 4.4+ replica set that has at least 6. Assert that both events occurred on the same server. +#### 3.3 Retryable Reads Caused by Overload Errors Are Retried on Same Replicaset Server When enableOverloadRetargeting is disabled + +This test MUST be executed against a MongoDB 4.4+ replica set that has at least one secondary, supports +`retryReads=true`, and has enabled the `configureFailPoint` command with the `errorLabels` option. + +1. Create a client `client` with `retryReads=true`, `readPreference=primaryPreferred`, and command event monitoring + enabled. + +2. Configure the following fail point for `client`: + + ```javascript + { + configureFailPoint: "failCommand", + mode: { times: 1 }, + data: { + failCommands: ["find"], + errorLabels: ["RetryableError", "SystemOverloadedError"] + errorCode: 6 + } + } + ``` + +3. Reset the command event monitor to clear the failpoint command from its stored events. + +4. Execute a `find` command with `client`. + +5. Assert that one failed command event and one successful command event occurred. + +6. Assert that both events occurred on the same server. + ## Changelog +- 2026-03-31: Add additional prose test for overload retargeting. + - 2026-02-19: Add prose tests for retrying against a replica set. - 2024-04-30: Migrated from reStructuredText to Markdown. diff --git a/source/transactions/tests/unified/backpressure-retryable-abort.json b/source/transactions/tests/unified/backpressure-retryable-abort.json index 53fc9c6f09..3a2a3b4368 100644 --- a/source/transactions/tests/unified/backpressure-retryable-abort.json +++ b/source/transactions/tests/unified/backpressure-retryable-abort.json @@ -213,7 +213,7 @@ ] }, { - "description": "abortTransaction is retried maxAttempts=5 times if backpressure labels are added", + "description": "abortTransaction is retried maxAttempts=2 times if backpressure labels are added", "operations": [ { "object": "testRunner", @@ -322,21 +322,6 @@ "commandName": "abortTransaction" } }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - }, { "commandStartedEvent": { "commandName": "abortTransaction" diff --git a/source/transactions/tests/unified/backpressure-retryable-abort.yml b/source/transactions/tests/unified/backpressure-retryable-abort.yml index 85532e1f60..bd8180dd1f 100644 --- a/source/transactions/tests/unified/backpressure-retryable-abort.yml +++ b/source/transactions/tests/unified/backpressure-retryable-abort.yml @@ -132,7 +132,7 @@ tests: - collectionName: *collection_name databaseName: *database_name documents: [] - - description: abortTransaction is retried maxAttempts=5 times if backpressure labels are added + - description: abortTransaction is retried maxAttempts=2 times if backpressure labels are added operations: - object: testRunner name: failPoint @@ -201,12 +201,6 @@ tests: commandName: abortTransaction - commandStartedEvent: commandName: abortTransaction - - commandStartedEvent: - commandName: abortTransaction - - commandStartedEvent: - commandName: abortTransaction - - commandStartedEvent: - commandName: abortTransaction outcome: - collectionName: *collection_name databaseName: *database_name diff --git a/source/transactions/tests/unified/backpressure-retryable-commit.json b/source/transactions/tests/unified/backpressure-retryable-commit.json index ae873561a9..844ed25ab4 100644 --- a/source/transactions/tests/unified/backpressure-retryable-commit.json +++ b/source/transactions/tests/unified/backpressure-retryable-commit.json @@ -222,7 +222,7 @@ ] }, { - "description": "commitTransaction is retried maxAttempts=5 times if backpressure labels are added", + "description": "commitTransaction is retried maxAttempts=2 times if backpressure labels are added", "runOnRequirements": [ { "serverless": "forbid" @@ -339,21 +339,6 @@ "commandName": "commitTransaction" } }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, { "commandStartedEvent": { "commandName": "commitTransaction" diff --git a/source/transactions/tests/unified/backpressure-retryable-commit.yml b/source/transactions/tests/unified/backpressure-retryable-commit.yml index 8099e1c1eb..8ee1b96c7f 100644 --- a/source/transactions/tests/unified/backpressure-retryable-commit.yml +++ b/source/transactions/tests/unified/backpressure-retryable-commit.yml @@ -135,7 +135,7 @@ tests: databaseName: *database_name documents: - _id: 1 - - description: commitTransaction is retried maxAttempts=5 times if backpressure labels are added + - description: commitTransaction is retried maxAttempts=2 times if backpressure labels are added runOnRequirements: - serverless: forbid operations: @@ -208,12 +208,6 @@ tests: commandName: commitTransaction - commandStartedEvent: commandName: commitTransaction - - commandStartedEvent: - commandName: commitTransaction - - commandStartedEvent: - commandName: commitTransaction - - commandStartedEvent: - commandName: commitTransaction outcome: - collectionName: *collection_name databaseName: *database_name diff --git a/source/transactions/tests/unified/backpressure-retryable-reads.json b/source/transactions/tests/unified/backpressure-retryable-reads.json index 731762830e..a859ec4bda 100644 --- a/source/transactions/tests/unified/backpressure-retryable-reads.json +++ b/source/transactions/tests/unified/backpressure-retryable-reads.json @@ -216,7 +216,7 @@ ] }, { - "description": "reads are retried maxAttempts=5 times if backpressure labels are added", + "description": "reads are retried maxAttempts=2 times if backpressure labels are added", "operations": [ { "object": "session0", @@ -300,21 +300,6 @@ "commandName": "find" } }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, { "commandStartedEvent": { "commandName": "abortTransaction" diff --git a/source/transactions/tests/unified/backpressure-retryable-reads.yml b/source/transactions/tests/unified/backpressure-retryable-reads.yml index 18bbdaadbf..7edc41fa47 100644 --- a/source/transactions/tests/unified/backpressure-retryable-reads.yml +++ b/source/transactions/tests/unified/backpressure-retryable-reads.yml @@ -134,7 +134,7 @@ tests: $$exists: false commandName: commitTransaction databaseName: admin - - description: reads are retried maxAttempts=5 times if backpressure labels are added + - description: reads are retried maxAttempts=2 times if backpressure labels are added operations: - object: *session0 name: startTransaction @@ -182,11 +182,5 @@ tests: commandName: find - commandStartedEvent: commandName: find - - commandStartedEvent: - commandName: find - - commandStartedEvent: - commandName: find - - commandStartedEvent: - commandName: find - commandStartedEvent: commandName: abortTransaction diff --git a/source/transactions/tests/unified/backpressure-retryable-writes.json b/source/transactions/tests/unified/backpressure-retryable-writes.json index eea0e6b5da..6cbf450e5f 100644 --- a/source/transactions/tests/unified/backpressure-retryable-writes.json +++ b/source/transactions/tests/unified/backpressure-retryable-writes.json @@ -244,7 +244,7 @@ ] }, { - "description": "writes are retried maxAttempts=5 times if backpressure labels are added", + "description": "writes are retried maxAttempts=2 times if backpressure labels are added", "operations": [ { "object": "session0", @@ -330,21 +330,6 @@ "commandName": "insert" } }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, { "commandStartedEvent": { "commandName": "abortTransaction" diff --git a/source/transactions/tests/unified/backpressure-retryable-writes.yml b/source/transactions/tests/unified/backpressure-retryable-writes.yml index ced8373e35..68c86cff2b 100644 --- a/source/transactions/tests/unified/backpressure-retryable-writes.yml +++ b/source/transactions/tests/unified/backpressure-retryable-writes.yml @@ -147,7 +147,7 @@ tests: documents: - { _id: 1 } - { _id: 2 } - - description: writes are retried maxAttempts=5 times if backpressure labels are added + - description: writes are retried maxAttempts=2 times if backpressure labels are added operations: - object: *session0 name: startTransaction @@ -196,12 +196,6 @@ tests: commandName: insert - commandStartedEvent: commandName: insert - - commandStartedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - - commandStartedEvent: - commandName: insert - commandStartedEvent: commandName: abortTransaction outcome: diff --git a/source/uri-options/tests/client-backpressure-options.json b/source/uri-options/tests/client-backpressure-options.json index 3fcf2c86b0..3e501d1f4c 100644 --- a/source/uri-options/tests/client-backpressure-options.json +++ b/source/uri-options/tests/client-backpressure-options.json @@ -1,30 +1,61 @@ { "tests": [ { - "description": "adaptiveRetries=true is parsed correctly", - "uri": "mongodb://example.com/?adaptiveRetries=true", + "description": "maxAdaptiveRetries is parsed correctly", + "uri": "mongodb://example.com/?maxAdaptiveRetries=3", "valid": true, "warning": false, "hosts": null, "auth": null, "options": { - "adaptiveRetries": true + "maxAdaptiveRetries": 3 } }, { - "description": "adaptiveRetries=false is parsed correctly", - "uri": "mongodb://example.com/?adaptiveRetries=false", + "description": "maxAdaptiveRetries=0 is parsed correctly", + "uri": "mongodb://example.com/?maxAdaptiveRetries=0", "valid": true, "warning": false, "hosts": null, "auth": null, "options": { - "adaptiveRetries": false + "maxAdaptiveRetries": 0 } }, { - "description": "adaptiveRetries with invalid value causes a warning", - "uri": "mongodb://example.com/?adaptiveRetries=invalid", + "description": "maxAdaptiveRetries with invalid value causes a warning", + "uri": "mongodb://example.com/?maxAdaptiveRetries=-5", + "valid": true, + "warning": true, + "hosts": null, + "auth": null, + "options": null + }, + { + "description": "enableOverloadRetargeting is parsed correctly", + "uri": "mongodb://example.com/?enableOverloadRetargeting=true", + "valid": true, + "warning": false, + "hosts": null, + "auth": null, + "options": { + "enableOverloadRetargeting": true + } + }, + { + "description": "enableOverloadRetargeting=false is parsed correctly", + "uri": "mongodb://example.com/?enableOverloadRetargeting=false", + "valid": true, + "warning": false, + "hosts": null, + "auth": null, + "options": { + "enableOverloadRetargeting": false + } + }, + { + "description": "enableOverloadRetargeting with invalid value causes a warning", + "uri": "mongodb://example.com/?enableOverloadRetargeting=invalid", "valid": true, "warning": true, "hosts": null, diff --git a/source/uri-options/tests/client-backpressure-options.yml b/source/uri-options/tests/client-backpressure-options.yml index 534261205f..c750b32e23 100644 --- a/source/uri-options/tests/client-backpressure-options.yml +++ b/source/uri-options/tests/client-backpressure-options.yml @@ -1,25 +1,51 @@ tests: - - description: "adaptiveRetries=true is parsed correctly" - uri: "mongodb://example.com/?adaptiveRetries=true" + description: "maxAdaptiveRetries is parsed correctly" + uri: "mongodb://example.com/?maxAdaptiveRetries=3" valid: true warning: false hosts: ~ auth: ~ options: - adaptiveRetries: true + maxAdaptiveRetries: 3 - - description: "adaptiveRetries=false is parsed correctly" - uri: "mongodb://example.com/?adaptiveRetries=false" + description: "maxAdaptiveRetries=0 is parsed correctly" + uri: "mongodb://example.com/?maxAdaptiveRetries=0" valid: true warning: false hosts: ~ auth: ~ options: - adaptiveRetries: false + maxAdaptiveRetries: 0 - - description: "adaptiveRetries with invalid value causes a warning" - uri: "mongodb://example.com/?adaptiveRetries=invalid" + description: "maxAdaptiveRetries with invalid value causes a warning" + uri: "mongodb://example.com/?maxAdaptiveRetries=-5" + valid: true + warning: true + hosts: ~ + auth: ~ + options: ~ + - + description: "enableOverloadRetargeting is parsed correctly" + uri: "mongodb://example.com/?enableOverloadRetargeting=true" + valid: true + warning: false + hosts: ~ + auth: ~ + options: + enableOverloadRetargeting: true + - + description: "enableOverloadRetargeting=false is parsed correctly" + uri: "mongodb://example.com/?enableOverloadRetargeting=false" + valid: true + warning: false + hosts: ~ + auth: ~ + options: + enableOverloadRetargeting: false + - + description: "enableOverloadRetargeting with invalid value causes a warning" + uri: "mongodb://example.com/?enableOverloadRetargeting=invalid" valid: true warning: true hosts: ~ diff --git a/source/uri-options/uri-options.md b/source/uri-options/uri-options.md index cd9e07184b..85a137671c 100644 --- a/source/uri-options/uri-options.md +++ b/source/uri-options/uri-options.md @@ -72,7 +72,8 @@ to URI options apply here. | Name | Accepted Values | Default Value | Optional to implement? | Description | | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| adaptiveRetries | "true" or "false" | "false" | no | Whether to enable adaptive reries as described by the [client backpressure spec](../client-backpressure/client-backpressure.md#token-bucket) | +| maxAdaptiveRetries | a non-negative integer | 2 | no | The maximum number of overload retries as described by the [client backpressure spec](../client-backpressure/client-backpressure.md#overload-retry-policy) | +| enableOverloadRetargeting | "true" or "false" | "false" | no | Whether or not to enable overload retargeting as described by the [client backpressure spec](../client-backpressure/client-backpressure.md#overload-retry-policy) | | appname | any string that meets the criteria listed in the [handshake spec](../mongodb-handshake/handshake.md#client-application-name) | no appname specified | no | Passed into the server in the client metadata as part of the connection handshake | | authMechanism | any string; valid values are defined in the [auth spec](../auth/auth.md#supported-authentication-methods) | None; default values for authentication exist for constructing authentication credentials per the [auth spec](../auth/auth.md#supported-authentication-methods), but there is no default for the URI option itself. | no | The authentication mechanism method to use for connection to the server | | authMechanismProperties | comma separated key:value pairs, e.g. "opt1:val1,opt2:val2" | no properties specified | no | Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI) |