Repository navigation
fix(compaction): default index_remap_mode from LANCE_FRAG_REUSE_REMAP_MODE - #80
Merged
Merged
Conversation
…_MODE `CompactionOptions::index_remap_mode` hardcoded `Direct` and was wired to nothing, so a deployment that moved its readers onto the compact reuse-remap form to bound memory still had every `compact_files` call that did not name a form build the per-row `HashMap<u64, Option<u64>>` -- the writer-side instance of exactly the growth the compact form exists to avoid. Nobody chose it; the default was simply never revisited when the compact form landed. Both sides expand the same reuse payload, so they take the same setting: the field now defaults to `default_frag_reuse_remap_mode()`, and its `serde(default)` does too, so a serialized options struct that omits the field agrees with a freshly defaulted one. With `LANCE_FRAG_REUSE_REMAP_MODE` unset the default is still `Direct`, so this is not a behaviour change on its own. `test_from_dataset_config_empty` pinned the default to `Direct` literally; it now pins it to the env-derived default, which is what the field actually promises. Found by `LANCE_FRAG_REUSE_REMAP_MODE=assert(compact)`, which took the `lance` lib suite from 39 failures to 8 in `optimize::tests` alone. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit a17ee65)
zehiko
approved these changes
Sep 10, 2026
Author
|
Not applicable upstream. This change defaults Exit condition: this patch is glue for #59's environment variable and leaves the fork together with #59. Label: |
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.
Related
release-8.0.0→release-10.0.0port; feat(frag-reuse): add LANCE_FRAG_REUSE_REMAP_MODE=assert(<mode>) #79 is the otherWhat
CompactionOptions::index_remap_modehardcodedDirectand was wired to nothing, so a deployment that moved its readers onto the compact reuse-remap form to bound memory still had everycompact_filescall that did not name a form build the per-rowHashMap<u64, Option<u64>>— the writer-side instance of exactly the growth the compact form exists to avoid. Nobody chose it; the default was never revisited when the compact form landed.Both sides expand the same reuse payload, so they take the same setting: the field now defaults to
default_frag_reuse_remap_mode(), and itsserde(default)does too, so a serialized options struct that omits the field agrees with a freshly defaulted one.With
LANCE_FRAG_REUSE_REMAP_MODEunset the default is stillDirect, so this is not a behaviour change on its own.Cherry-pick of
a17ee6527fromrelease-8.0.0, author preserved.default_frag_reuse_remap_mode()is already on this branch from #59, so the port is the wiring only.Testing
cargo check -p lance --testsclean;from_dataset_configtests pass with the env var unset and set tocompact.test_from_dataset_config_emptypinned the default toDirectliterally; it now pins it to the env-derived default, which is what the field actually promises. That assertion is necessarily self-referential:default_frag_reuse_remap_mode()caches in aOnceLock, so a test cannot vary the env var within one test binary. The wiring itself is a two-line change and visible in the diff.Note
optimize::testsis flaky onrelease-10.0.0independently of this change: back-to-back runs of the same tree gave115 passed; 3 failedthen118 passed; 0 failed.Merge order
Nothing here depends on #79. The production change applied to
release-10.0.0with no conflict; the only conflict in the cherry-pick was theReadParams::frag_reuse_remap_modedoc comment, whose source version carries #79'sassert(<mode>)paragraph as context. That paragraph is left to #79.Both PRs touch that doc block and
default_frag_reuse_remap_mode, so whichever merges second wants a rebase. Either order works.Compatibility
None with
LANCE_FRAG_REUSE_REMAP_MODEunset. Where it is set, compaction now follows it instead of always building the direct form — which is the point.