pub struct CheckpointConfig {
pub interval: Duration,
pub warn_pages: u64,
pub high_water_pages: u64,
}Expand description
Configuration for the WAL checkpoint background task.
All fields default to conservative production values. Override via the environment variables documented on each field.
Fields§
§interval: DurationHow often to run a passive checkpoint when there is no active write.
Overridable via KHIVE_CHECKPOINT_INTERVAL_MS (milliseconds).
Default: 500 ms.
warn_pages: u64WAL page count above which a warning is logged.
Overridable via KHIVE_WAL_WARN_PAGES.
Default: 2000 pages (~8 MB at 4 KiB page size).
high_water_pages: u64WAL page count above which a high-pressure WARNING is logged.
The periodic task always runs PASSIVE regardless; this threshold signals that a long-lived reader may be pinning an old WAL snapshot that PASSIVE cannot reclaim. An operator can then schedule a blocking TRUNCATE at a safe moment outside normal write traffic.
Overridable via KHIVE_WAL_HIGH_WATER_PAGES.
Default: 6000 pages (~24 MB at 4 KiB page size).
Implementations§
Source§impl CheckpointConfig
impl CheckpointConfig
Sourcepub fn from_env() -> CheckpointConfig
pub fn from_env() -> CheckpointConfig
Build a CheckpointConfig from the environment.
Unset or unparseable variables fall back to the compiled-in defaults.
Trait Implementations§
Source§impl Clone for CheckpointConfig
impl Clone for CheckpointConfig
Source§fn clone(&self) -> CheckpointConfig
fn clone(&self) -> CheckpointConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more