Expand description
Disk-space measurement and eviction-candidate selection.
This module is the single source of truth for two questions:
- How much free space is left on each partition that hosts node data?
- Which node should be evicted next to reclaim space?
Both the low-disk eviction monitor (which actually evicts) and the fleet health layer (which warns the user before an eviction and names the candidate) call into here, so they can never disagree about who is next.
Nodes that live on the same filesystem partition share its free space, so eviction is always decided per partition: evicting one node frees space for every other node on that partition.
Structs§
- Node
Disk Usage - Measured disk usage of a single node’s data directory.
- Partition
Key - Opaque identifier for the filesystem partition a path lives on.
- Partition
State - State of one partition that hosts node data: how much space is free and which running nodes live on it (with their measured sizes).
Functions§
- available_
space - Free bytes on the partition hosting
path(or its nearest existing ancestor). - dir_
size - Recursively sum the allocated disk usage of every regular file under
path. - partition_
states - Group the given running nodes by partition, measuring each node’s data-directory size and each partition’s free space.