Repository navigation
Conversation
Keep spilled row-lineage carriers when pruning projected files from updated and new fragments. Extend the Update mode regression to retain separate carriers for all three lineage fields while still dropping projected files. Complete the upstream restore-conflict test initializer so the Rust test suite can compile.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Author
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Xuanwo
approved these changes
Sep 30, 2026
BubbleCal
added a commit
that referenced
this pull request
Oct 8, 2026
## Problem Spilled row lineage (#9250) is about to be declared stable. The tests in `rust/lance/src/dataset/rowids/spill.rs` each pin how one write places lineage, but nothing checks what a sequence of later operations does to lineage that is already spilled. That is where it has broken: #9623 fixed an update that dropped a fragment's lineage-only file because no schema field lived in it, and none of the existing tests caught it. ## What changed Adds `spilled_lineage_reads_like_inline_lineage`, a differential test in `rust/lance/src/dataset/rowids/spill.rs`. Each scenario runs the same steps on two tables: one that spills every sequence (inline budget 0) and one that keeps them inline, as released builds do. After every step it asserts that: - every row has the same row id, created-at and last-updated-at version on both tables, and keys stay unique; - both tables validate, and `take_rows` by row id returns the right rows; - a filter on `j` returns the same rows, through the zone map and the fragment reuse index where a scenario builds them; - the spilled table sets the spilled-lineage feature flag exactly when a fragment spills, and the inline table never spills. At the end both tables are reopened cold and every version they keep is compared. The 18 scenarios cover: - consecutive updates, deletes and appends; - upserts and in-place column patches through merge_insert; - add, cast and drop column, `Dataset::merge` and `DataReplacement`; - reencode, binary-copy and deferred-remap compaction, the last with a zone map so a fragment reuse index is written; - a compaction racing an append or a delete, and an update racing a compaction; - restore, cleanup, shallow and deep clone, and branches. A compaction whose fragments receive a concurrent delete loses with a retryable conflict on both tables. That is existing behavior; the scenario asserts it and checks that both tables still agree afterwards. ## Validation - All 54 tests in `dataset::rowids::spill` pass. Each new case takes at most 0.43 s in a debug build, including process startup. - Reverting the fix from #9623 in `manifest_build.rs` makes all 18 scenarios fail with the error that PR describes. - `cargo fmt --all -- --check` and `cargo clippy --all --tests --benches -- -D warnings` pass. Run on an x86 Linux VM (r8i.8xlarge). ## Limitations Not covered: overwrite, merge_insert racing other writes, remote object stores (the scenarios use the local filesystem), spilling at the default 200 KiB budget (every scenario uses budget 0), and the Python and Java bindings. Refs #9250 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Problem and context
An update can fail when a fragment stores its row lineage in data-file columns:
Row lineage records each row's stable ID, creation version, and last-update version. To keep large per-row sequences out of the manifest, Lance's opt-in spilled-lineage feature can store them as hidden columns in a fragment's data files. Their reserved field IDs (
-3,-4, and-5) are absent from the user schema. A fragment's metadata marks which sequences use this storage, and its file list must retain the files carrying those columns.The regression comes from the interaction between two changes:
The new Update pruning checked only user-schema field IDs. Consequently, it also discarded files containing only hidden lineage columns. This check runs during Update manifest construction even without a concurrent schema change, so an ordinary update can trigger the failure.
For example, a fragment can have these files:
Pruning should remove
old-column.lanceand retain the other two. Before this fix it also removedlineage.lancefrom the fragment's file list, while the metadata still said row IDs were stored in a column. Commit-time validation then rejected the inconsistent manifest. The observed failure is a rejected commit; this pruning does not physically delete the file.This reproduced in five existing spill tests and caused the Rust CI failures on Linux x86_64, Linux ARM, Windows, and macOS observed on #9034. The failure is in shared Update manifest construction and does not depend on that PR's ignored-index option.
Fix
In both Update pruning locations, retain a file when it contains either a live user field or a spilled lineage field required by that fragment's metadata. This follows the existing Project rule, preserves all three lineage kinds, and continues to remove files containing only projected-out user fields. Carrier validation remains in place. No public API or file format changes are needed.
Extend the existing Update manifest regression across the unspecified update mode, RewriteRows, and RewriteColumns, each with and without spilled lineage (six cases). The v2 fixtures use separate files for row IDs, creation versions, and last-update versions, and assert the exact retained file lists for both updated and new fragments.
The second changed file only completes the restore/config conflict test's
TransactionRebaseinitializer. Its six missing fields otherwise prevent Rust test targets from compiling on the base revision; this is a separate test-build fix.Validation
cargo test -p lance-table --locked: 580 unit tests and 3 doc tests passed.cargo test -p lance --lib --locked: 4488 passed, 0 failed, 3 existing ignored tests; all five previously failing spill cases passed.cargo fmt --allandcargo clippy --all --tests --benches -- -D warningspassed.