pub struct ReadReplicaPolicy {
pub pin_after_write: Duration,
pub max_lag: Option<Duration>,
pub health_probe_interval: Duration,
}Expand description
ReadReplicaConfig without the URLs: how replica routing behaves,
separated from where the replicas are (#957).
The split exists because the two halves have different owners once tenant
pools carry replicas. A tenant registration names its own replica URLs, the
same way it names its own primary connection string — but the pin window, the
staleness budget and the probe cadence are the operator’s policy, stamped
onto every tenant pool by make_executor_factory, exactly as [database_tls]
is (#801). A tenant that could send its own max_lag in a registration body
would be choosing how stale its reads may be, against a server whose
operator already decided.
Default carries the shipped defaults — a 5 s pin, no staleness budget, a
1 s probe cadence — so they live in one place rather than once per binary.
Fields§
§pin_after_write: Duration§max_lag: Option<Duration>§health_probe_interval: DurationImplementations§
Source§impl ReadReplicaPolicy
impl ReadReplicaPolicy
Sourcepub fn with_urls(&self, urls: Vec<String>) -> Option<ReadReplicaConfig>
pub fn with_urls(&self, urls: Vec<String>) -> Option<ReadReplicaConfig>
Apply this policy to urls, or None when there are no replicas.
Returning None for an empty list is what keeps a pool site that has no
replicas from constructing the one shape
ReadReplicaConfig refuses to build.
Trait Implementations§
Source§impl Clone for ReadReplicaPolicy
impl Clone for ReadReplicaPolicy
Source§fn clone(&self) -> ReadReplicaPolicy
fn clone(&self) -> ReadReplicaPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more