Skip to main content

Module pool_config

Module pool_config 

Source
Expand description

Process-wide installation and configuration point for the buffer pool that backs chunk spilling.

Chunk spill consumers, arriving with the chunk-batcher work, resolve their backing through active_pool at each spill decision, so live reconfiguration takes effect on the next call. The pool itself (mz_ore::pool::Pool) is a process singleton: live chunk handles keep their Arc into it, so replacing it on reconfigure would split residency accounting across two budgets. Operator-driven tunes instead retune the one instance in place via apply_pool_config.

See doc/developer/design/20260610_buffer_managed_state.md for the buffer-pool design.

Modules§

metrics
Prometheus metrics for the process-wide buffer pool.

Structs§

PoolPagerConfig
Inputs to apply_pool_config. All sizes are absolute bytes; fractions are resolved by the caller against physical RAM (see mz_ore::memory::physical_memory_bytes), never against an announced limit that may include swap.

Functions§

active_pool
Returns the pool only when apply_pool_config has installed and budgeted it, and never initializes anything itself. Chunk spill consumers resolve their backing through this at each spill decision, so an unconfigured or gated-off process keeps every chunk resident.
apply_pool_config
Applies a buffer-pool configuration, installing the pool as the process’s spill mechanism. This is the only path that constructs the pool. A process that never calls it, because the spill gate is off or it is unconfigured, never reserves the pool’s address space or spawns its spill threads. Returns false (and changes nothing) if the pool is unavailable because its virtual reservation failed.
global_pool
Returns the process-wide buffer pool, initializing it on first call. None if the virtual reservation failed at first use.
global_pool_peek
Returns the process-wide buffer pool only if something already initialized it; never triggers the virtual reservation itself. Metrics scrapes read through this so that observing a process (which may never install the pool) does not mmap the pool’s address space as a side effect.