Expand description
One writer at a time per store.
Indexing writes SQLite rows and rewrites index.tv. Two runs against one
store interleave those writes and the index stops agreeing with the
database, which surfaces later as searches returning nothing for chunks that
plainly exist.
The lock is an OS advisory lock on a file in the store directory, not the existence of that file. That distinction matters: the kernel drops the lock when the holding process dies, so a run killed with SIGKILL or lost to a power cut leaves nothing to clean up. A lock file that meant “locked by existing” would wedge the store until someone deleted it by hand.
Structs§
- Store
Lock - Held for the duration of an index run. Dropping it releases the lock.