Expand description
Generic primitives shared by every per-engine outbound sync queue.
Each *Outbound (columnar, vector, fts, spatial, timeseries) shares the
same shape: a mutex-protected Vec<Pending…> plus a monotonic batch-ID
counter for ACK correlation. Before this module was extracted that pattern
was copy-pasted across five files (~1.1k lines of near-identical
drain/ack/requeue plumbing). It now lives here exactly once.
Engine-specific code only writes:
- the
Pending…struct (a row payload + abatch_idfield) - the public-facing wrapper that calls
enqueue/drain/retain/requeueand exposes engine-specificacknowledge_*semantics
The mutex guards are deliberately recovered with let Ok(mut g) = lock:
a poisoned outbound queue means another thread already crashed mid-sync,
and silently dropping further sync work is preferable to propagating the
poison and tearing down the whole runtime — the writes are already durable
in the local engine.
Structs§
- Batch
IdGen - Monotonic batch-ID generator shared between sibling queues (e.g. the insert and delete queues of a single engine) so every in-flight ACK ID is globally unique inside one outbound.
- Pending
Queue - Mutex-wrapped pending queue.
Tis the engine-specific pending entry (e.g.PendingVectorInsert).