fix(watch): periodic Lance compact/prune to cap memory growth#16
Merged
Conversation
The watch loop performed delete+insert per change event without ever calling compact() or prune(). On long-running watchers, the Lance dataset accumulated thousands of version manifests and data fragments, driving RSS to multi-GB. Observed: 7.6 GB RSS + 4.2 GB swap on a 76K-file watcher after 8 days, with 27,750 versions / 7,384 fragments. Track a file-churn counter and wall-clock since last compaction in the watch loop. Trigger compact()+prune() when the counter reaches 100 files OR 30 minutes elapse with any churn, mirroring the post-index cleanup in cli/index.rs. Fixes #15 (bo-07l) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
VectorStore::compact()+prune()calls to thebobbin watchloopsrc/cli/index.rsWhy
Per #15, the watch loop issued
delete_by_file+insertfor every change without ever reclaiming Lance fragments or version manifests. One long-running watcher accumulated 27,750 versions / 7,384 fragments and consumed 7.6 GB RSS + 4.2 GB swap over 8 days.Test plan
cargo build --bin bobbincleancargo clippy --bin bobbin --no-deps— no new warnings from the changed regionbobbin watchon a busy repo, touch >100 files, confirmCompacted lance dataset (N files since last)log line appears.bobbin/vectors/chunks.lance/_versions/count drops after compaction cycleFixes #15
🤖 Generated with Claude Code