You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This specification adds the ability for drivers to automatically retry requests that fail due to server overload errors
11
11
while applying backpressure to avoid further overloading the server.
12
12
13
+
The retry behaviors defined in this specification are separate from and complementary to the retry behaviors defined in
14
+
the [Retryable Reads](../retryable-reads/retryable-reads.md) and
15
+
[Retryable Writes](../retryable-writes/retryable-writes.md) specifications. This specification expands retry support to
16
+
all commands when specific server overload conditions are encountered, regardless of whether the command would normally
17
+
be retryable under those specifications.
18
+
13
19
## META
14
20
15
21
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
@@ -64,8 +70,8 @@ For example, when a request exceeds the ingress request rate limit, the followin
64
70
}
65
71
```
66
72
67
-
Note that an error is not guaranteed to contain both the `SystemOverloadedError` and the `RetryableError` labels, if it
68
-
contains one of them.
73
+
Note that an error is not guaranteed to contain both the `SystemOverloadedError` and the `RetryableError` labels just
74
+
because it contains one of them.
69
75
70
76
#### Goodput
71
77
@@ -76,6 +82,24 @@ See [goodput](https://en.wikipedia.org/wiki/Goodput).
76
82
77
83
### Requirements for Client Backpressure
78
84
85
+
#### Driver mechanisms subject to the retry policy
86
+
87
+
Commands sent by the driver to the server are subject to the retry policy defined in this specification unless the
88
+
command is included in the exceptions below.
89
+
90
+
Driver commands not subject to the overload retry policy:
91
+
92
+
-[monitoring commands](../server-discovery-and-monitoring/server-monitoring.md#monitoring) and
93
+
[round-trip time pingers](../server-discovery-and-monitoring/server-monitoring.md#measuring-rtt) (see
94
+
[Why not apply the overload retry policy to monitoring and RTT connections?](./client-backpressure.md#why-not-apply-the-overload-retry-policy-to-monitoring-and-rtt-connections))
95
+
- commands executed during [authentication](../auth/auth.md) (see
96
+
[Why not apply the overload policy to authentication commands or reauthentication commands?](./client-backpressure.md#why-not-apply-the-overload-policy-to-authentication-commands-or-reauthentication-commands))
97
+
98
+
Note: Drivers communicate with [mongocryptd](../client-side-encryption/client-side-encryption.md#mongocryptd) using the
99
+
driver's `runCommand()` API. Consequently, drivers will implicitly apply the retry policy to communication with
100
+
mongocryptd, although practice the retry policy would never be unused because mongocryptd connections are not
101
+
authenticated.
102
+
79
103
#### Overload retry policy
80
104
81
105
This specification expands the driver's retry ability to all commands if the error indicates that it is a retryable
@@ -112,9 +136,10 @@ rules:
112
136
-`BASE_BACKOFF` is constant 100ms.
113
137
-`MAX_BACKOFF` is 10000ms.
114
138
- This results in delays of 100ms, 200ms, 400ms, 800ms, and 1600ms before accounting for jitter.
115
-
8. If the request is eligible for retry (as outlined in step 4), the client MUST add the previously used server's
116
-
address to the list of deprioritized server addresses for server selection.
117
-
9. If the request is eligible for retry (as outlined in step 4) and is a retryable write:
139
+
8. If the request is eligible for retry (as outlined in step 5), the client MUST add the previously used server's
140
+
address to the list of deprioritized server addresses for
0 commit comments