Skip to main content

Module maintenance

Module maintenance 

Source
Expand description

The drain thread: applies the index outbox every few seconds and, when the outbox is quiet and the interval has passed, repairs the store with the writable indexes it owns. On-demand repairs arrive over a channel so the same thread services them; two writers never exist.

Structs§

DrainLoop
RepairRequest
WriterSlot
The drain thread’s writable indexes. usearch cannot mutate a viewed index, so an open writer holds its own anonymous copy of the vectors beside the reader’s mmap; the slot drops it once WRITER_IDLE has passed since its last operation finished, and reopens it from the persisted files when work arrives. A writer holding changes its files lack is kept, because a drain commits its store-side deletes before it persists, so only that writer still holds those removals.

Enums§

DrainRequest
Work only the drain thread may do, because it owns the writable indexes.
PauseCommand

Functions§

run_repair
Runs a repair and re-measures the store afterwards, on whatever index handle the caller owns (the writer on the drain thread, none when the indexes never opened or a released writer could not reopen).