Skip to content

fix: prune overlays for dropped columns - #9314

Merged
wjones127 merged 2 commits into
mainfrom
gatekeeper/fix-9313-1
Oct 5, 2026
Merged

wjones127 merged 2 commits into
mainfrom
gatekeeper/fix-9313-1

Conversation

@lance-gatefixer

Copy link
Copy Markdown
Contributor

Summary

  • prune overlay files that no longer supply any field in the committed schema
  • apply the same rule to both Project and Merge schema changes
  • cover multi-fragment keep and drop cases with a regression test

Root cause

Operation::Project filtered base data files against the projected schema but left each fragment overlay list unchanged. Operation::Merge could publish the same stale overlay metadata when removing fields. Those overlay files remained referenced even though readers could no longer use any of their fields.

Validation

  • cargo test -p lance-table
  • cargo fmt --all
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #9313

@github-actions github-actions Bot added the bug Something isn't working label Sep 16, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

This fixes the manifest-retention leak at its authoritative boundary: both schema-changing paths remove overlays that no longer provide any live field while preserving mixed overlays. The focused multi-fragment regression covers both Project and Merge.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 16, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 16, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

The effective patch is unchanged after the base merge. It still fixes the manifest-retention leak at its authoritative boundary: both schema-changing paths remove overlays that no longer provide any live field while preserving mixed overlays.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 16, 2026
@wjones127
wjones127 merged commit 9ec4639 into main Oct 5, 2026
39 checks passed
@wjones127
wjones127 deleted the gatekeeper/fix-9313-1 branch October 5, 2026 21:18
wjones127 added a commit to wjones127/lance that referenced this pull request Oct 5, 2026
…#9217, lance-format#9313

Expose rechunk_row_lineage (main's replacement for rechunk_stable_row_ids)
for the rewrite scenario. Un-ignore the three fixed-bug tests as regression
tests and regenerate both grids. The (data_overlay, project) cell stays
excluded under lance-format#9724, which lance-format#9314 did not cover.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Xuanwo pushed a commit that referenced this pull request Oct 23, 2026
…s its field (#10123)

Closes #9724.

A `DataOverlay` staged at version N still committed after a concurrent
`Project` at N+1 dropped the field it overlays. `check_data_overlay_txn`
treated every `Project` as compatible, and the overlay build arm doesn't
look at the schema, so the overlay landed covering only fields that no
longer exist. #9314 handles the other order, where `Project` prunes
overlays that are already committed.

This makes `Project` a retryable conflict for an overlay when the
projected schema no longer contains one of the overlay's fields, which
is the first option the issue gives. A projection that keeps all of the
overlay's fields (a rename, or dropping some other column) is still
compatible.

Testing: `test_data_overlay_conflicts` gained two `Project` cases, one
keeping the overlaid field (compatible) and one dropping it (retryable).
The dropping case fails on main. `cargo test -p lance --lib
io::commit::conflict_resolver` and `cargo test -p lance --lib overlay`
pass, `cargo fmt --all` is clean, and `cargo clippy -p lance --lib
--tests -- -D warnings` passes; I didn't run the full-workspace clippy.

#9220 leaves the `(DataOverlay, Project)` cell out of its conflict
matrix because of this bug; with this change it should be able to go
back in.

I used an AI coding assistant to help write this change and the test; I
reviewed the diff and ran the checks above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Project leaves overlays behind for the columns it drops

1 participant