Fix/lancedb periodic compaction - #4833
Open
SahilArate wants to merge 2 commits into
Open
Conversation
Adds support for JSON documents where the target list is nested inside a dict (e.g. {"records": {"items": [...]}}) instead of only a flat top-level list. Auto-detects a single nested array, or accepts an explicit json_path when multiple arrays exist. Each chunk now carries json_path and, when present, json_context metadata. Flat top-level list behavior is unchanged. Fixes topoteretes#4236.
merge_insert mints a new table version and data fragment on every upsert, and nothing outside a one-off migration ever compacts them. On a long-lived deployment this grows without bound: one reported store hit 6,592 versions / 6,557 fragments across 20 tables, 937MB for a 2,461-node graph. Add best-effort periodic compaction: every vector_db_compaction_write_interval writes to a table (default 25, 0 disables), call optimize(cleanup_older_than=timedelta(seconds=0)) so old fragment files are actually removed, not just merged. Mirrors the same fail-open compaction pattern already used after re-keying in _vector_rekey.py. Tested: all 43 existing LanceDB unit tests still pass, plus 3 new tests confirming compaction triggers at the configured interval, the interval=0 opt-out preserves current behavior exactly, and row data survives compaction unchanged. Fixes topoteretes#4684
SahilArate
requested review from
Vasilije1990,
dexters1 and
siillee
as code owners
August 30, 2026 11:41
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.
Description
Acceptance Criteria
Type of Change
Screenshots
Pre-submission Checklist
CONTRIBUTING.md)DCO Affirmation
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.