Skip to main content

Module durable_queue

Module durable_queue 

Source
Expand description

Durable FIFO queue backed by a StorageEngine namespace.

Used by the columnar and timeseries outbound sync paths to persist pending row batches across restarts. Keys are big-endian monotonic u64 IDs ([u8; 8]), giving natural FIFO order because byte-comparable big-endian integers sort in ascending insertion order.

§Backpressure

When DurableOutboundQueue::len reaches the configured cap, DurableOutboundQueue::enqueue returns LiteError::Backpressure instead of writing to storage. RAM is bounded regardless of cap; the items themselves always live on disk.

§Drain and acknowledge

[drain_batch] reads up to limit entries in FIFO order without removing them. The caller sends the payloads to Origin, then calls [ack_keys] with the confirmed keys to delete them. Un-acked entries survive a crash and are re-drained on the next connect.

Structs§

DurableOutboundQueue
Durable FIFO outbound queue backed by a StorageEngine namespace.