Skip to content

Commit e816b86

Browse files
RUST-2448 Update client backpressure docs (#1730)
1 parent 49a5c7d commit e816b86

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

driver/src/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ const DEFAULT_SERVER_SELECTION_TIMEOUT: Duration = Duration::from_secs(30);
120120
/// details.
121121
///
122122
/// ## Overload Retry Behavior
123-
/// All operations executed by a `Client` may retry if the selected server is overloaded. For
124-
/// details on server load-shedding, see the documentation for
125-
/// [Intelligent Workload Management](https://www.mongodb.com/docs/atlas/intelligent-workload-management/)
126-
/// and [Overload Errors](https://www.mongodb.com/docs/atlas/overload-errors).
123+
/// All operations executed by a `Client` may retry if the selected server is overloaded. An
124+
/// overload error is indicated by the
125+
/// [`SYSTEM_OVERLOADED_ERROR`](crate::error::SYSTEM_OVERLOADED_ERROR) error label. This behavior is
126+
/// functional with MongoDB Atlas server version 9.0 and above.
127127
///
128128
/// The following options can be configured to customize this behavior:
129129
/// - Set [`ClientOptions::retry_reads`] to false to disable retrying all reads. Note that this will

driver/src/client/options.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,11 +689,15 @@ pub struct ClientOptions {
689689

690690
/// The maximum number of retries to perform when overload errors are encountered. Defaults to
691691
/// 2.
692+
///
693+
/// This option only has an effect with MongoDB Atlas server version 9.0 and above.
692694
pub max_adaptive_retries: Option<u32>,
693695

694696
/// Whether to enable overload retargeting when overload errors are encountered. When overload
695697
/// retargeting is enabled, the server on which an overload error occurs is deprioritized
696698
/// when selecting a server for a retry attempt. Defaults to false.
699+
///
700+
/// This option only has an effect with MongoDB Atlas server version 9.0 and above.
697701
pub enable_overload_retargeting: Option<bool>,
698702

699703
/// Information from the SRV URI that generated these client options, if applicable.
@@ -1088,11 +1092,15 @@ pub struct ConnectionString {
10881092

10891093
/// The maximum number of retries to perform when overload errors are encountered. Defaults to
10901094
/// 2.
1095+
///
1096+
/// This option only has an effect with MongoDB Atlas server version 9.0 and above.
10911097
pub max_adaptive_retries: Option<u32>,
10921098

10931099
/// Whether to enable overload retargeting when overload errors are encountered. When overload
10941100
/// retargeting is enabled, the server on which an overload error occurs is deprioritized
10951101
/// when selecting a server for a retry attempt. Defaults to false.
1102+
///
1103+
/// This option only has an effect with MongoDB Atlas server version 9.0 and above.
10961104
pub enable_overload_retargeting: Option<bool>,
10971105

10981106
#[serde(serialize_with = "serde_util::serialize_duration_option_as_int_millis")]

0 commit comments

Comments
 (0)