Repository navigation
feat(frag-reuse): add LANCE_FRAG_REUSE_REMAP_MODE=assert(<mode>) - #79
Merged
Merged
Conversation
zehiko
approved these changes
Sep 10, 2026
This was referenced Sep 10, 2026
A deployment that has committed to the compact reuse-remap form still has no way to tell whether some code path quietly falls back to the direct one -- it finds out as the memory blowup the compact form exists to avoid, long after the call that chose it. `LANCE_FRAG_REUSE_REMAP_MODE=assert(compact)` selects the compact form as the process default and turns every other form into a panic, so the offending call site shows up as a backtrace instead. The assert is a plain `assert!`, not `debug_assert!`, because the deployments that need it run release builds. Three sites cover the ways a form is chosen: `Dataset::checkout_manifest` (every dataset open, whichever path built the mode), `open_frag_reuse_index_with_mode` (callers that pass a mode not coming from a `Dataset`), and `commit_compaction` (`CompactionOptions::index_remap_mode`). The compaction one is gated on `needs_remapping`, since a stable-row-id or deferred compaction never consults the mode and asserting there would report configuration that costs nothing. Arming it warns once, on the read that fixes the setting for the process, so an operator can tell a later panic apart from an unrelated crash. The plain `direct`/`compact` spellings are unchanged, and an unparsable `assert(...)` falls back to the existing warn-and-use-direct behaviour rather than failing an open. The production change applies unchanged: release-10.0.0 already carries `parse_frag_reuse_remap_mode` and `default_frag_reuse_remap_mode` from #59. The one conflict was the `#[case]` list of `test_parse_frag_reuse_remap_mode`, resolved to the source's cases and its `expected_asserted` column while keeping this branch's `unparsable` spelling, which is what the typos hook and the rest of the tree use. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 49d9a40)
amunra
force-pushed
the
adam/fri-assert-mode-r10
branch
from
September 10, 2026 11:10
4632e60 to
f5e769b
Compare
Author
|
Relabelled |
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.0portWhat
LANCE_FRAG_REUSE_REMAP_MODE=assert(compact)selects the compact reuse-remap form as the process default and turns every other form into a panic, so a deployment committed to one form finds the code path that picks the other as a backtrace rather than as the memory blowup the compact form exists to avoid.Three sites cover the ways a form is chosen:
Dataset::checkout_manifest,open_frag_reuse_index_with_mode, andcommit_compaction. The compaction one is gated onneeds_remapping, since a stable-row-id or deferred compaction never consults the mode.Arming it warns once. The plain
direct/compactspellings are unchanged, and an unparsableassert(...)falls back to warn-and-use-direct rather than failing an open.Cherry-pick of
49d9a4093fromrelease-8.0.0, author preserved. The production change applies unchanged — this branch already hasparse_frag_reuse_remap_modeanddefault_frag_reuse_remap_modefrom #59. The one conflict was the#[case]list oftest_parse_frag_reuse_remap_mode, resolved to the source's cases and itsexpected_assertedcolumn, keeping this branch'sunparsablespelling.Testing
test_parse_frag_reuse_remap_modecovers 13 cases: the 7 existing plusassert(compact),assert(direct), upper case, padded,assert(nonsense)and unterminatedassert(compact.The assert was shown to fire end to end, not merely parse:
optimize::testspasses with the env var unset (118/118) and produces 13 failures underLANCE_FRAG_REUSE_REMAP_MODE=assert(compact), all at the newassert_frag_reuse_remap_mode. Several of those are tests that deliberately requestdirect, so they are correct panics — running a whole suite under the assert is not the intended use.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.Compatibility
None. With
LANCE_FRAG_REUSE_REMAP_MODEunset or set todirect/compact, behaviour is unchanged; only the newassert(...)spelling adds the panic.