Skip to main content

Module flush

Module flush 

Source
Expand description

Memtable freeze-and-flush mechanism.

This module implements the lifecycle of a memtable: freeze the active memtable (making it immutable), swap in a fresh one, flush the frozen memtable to a segment file via SegmentWriter, and optionally truncate the WAL up to the flushed sequence number.

§Flush triggers

Flush is triggered when:

  • estimated_size > memtable_flush_threshold
  • A time-shard boundary is crossed

§Memory bounds

If the combined size of active + frozen memtables exceeds max_memtable_memory, new inserts are rejected with MemtableError::CapacityExceeded.

Structs§

FlushConfig
Configuration for the flush controller.
FlushController
Manages the active and frozen memtable lifecycle.
FlushResult
Result of a flush operation for a single measurement.