Expand description
Change-detection cache backed by redb.
For each indexed file we remember (inode, mtime, size, content_hash) plus
where the current version lives (segment_id, doc_id). On a re-index or a
filesystem event we do a cheap mtime+size pre-check before hashing, and
only re-index when the fast hash actually changed. This rejects spurious
touches and lets us tombstone the stale doc.
The cache is purely an optimization: it can always be rebuilt by re-indexing.
That property drives two design choices below — a stored schema version that
wipes the cache on any FileRecord layout change (degrading to a re-index
instead of a hard deserialize error), and relaxed write durability on the hot
apply path (a crash just costs a re-index).
Structs§
- Cache
- Handle to the on-disk change-detection cache.
- File
Record - Per-file record used for incremental indexing.