userver: storages::postgres::TopologySettings Struct Reference
Loading...
Searching...
No Matches
storages::postgres::TopologySettings Struct Reference

#include <userver/storages/postgres/options.hpp>

Detailed Description

PostgreSQL topology options.

Dynamic option POSTGRES_TOPOLOGY_SETTINGS

Definition at line 192 of file options.hpp.

Public Member Functions

std::optional< std::chrono::milliseconds > GetEffectiveRttThreshold () const noexcept
 Returns the configured RTT threshold, or std::nullopt when RTT-based preference is disabled.

Public Attributes

std::chrono::milliseconds max_replication_lag {kDefaultMaxReplicationLag}
 Maximum replication lag. Once the replica lag exceeds this value it will be automatically disabled.
std::unordered_set< std::string, ::utils::StrIcaseHash, ::utils::StrIcaseEqual > disabled_replicas {}
 List of manually disabled replicas (FQDNs).
std::chrono::milliseconds rtt_threshold {kDefaultRttThreshold}
bool rtt_threshold_enabled {true}
 Controlled by POSTGRES_RTT_THRESHOLD_ENABLED; enabled by default.

Member Function Documentation

◆ GetEffectiveRttThreshold()

std::optional< std::chrono::milliseconds > storages::postgres::TopologySettings::GetEffectiveRttThreshold ( ) const
inlinenoexcept

Returns the configured RTT threshold, or std::nullopt when RTT-based preference is disabled.

Definition at line 209 of file options.hpp.

Member Data Documentation

◆ disabled_replicas

std::unordered_set<std::string, ::utils::StrIcaseHash, ::utils::StrIcaseEqual> storages::postgres::TopologySettings::disabled_replicas {}

List of manually disabled replicas (FQDNs).

Definition at line 198 of file options.hpp.

◆ max_replication_lag

std::chrono::milliseconds storages::postgres::TopologySettings::max_replication_lag {kDefaultMaxReplicationLag}

Maximum replication lag. Once the replica lag exceeds this value it will be automatically disabled.

Definition at line 194 of file options.hpp.

◆ rtt_threshold

std::chrono::milliseconds storages::postgres::TopologySettings::rtt_threshold {kDefaultRttThreshold}

Maximum EWMA RTT difference from the fastest host in the candidate set. Hosts outside this threshold are used only if no host has a known RTT. Zero is a valid threshold. Static and dynamic configuration values are limited to one minute.

Definition at line 203 of file options.hpp.

◆ rtt_threshold_enabled

bool storages::postgres::TopologySettings::rtt_threshold_enabled {true}

Controlled by POSTGRES_RTT_THRESHOLD_ENABLED; enabled by default.

Definition at line 206 of file options.hpp.


The documentation for this struct was generated from the following file: