Skip to content

feat(dataset): support explicit deletion file paths in commit cache and cleanup - #10925

Open
geruh wants to merge 1 commit into
lance-format:mainfrom
geruh:deletes-engine-path
Open

geruh wants to merge 1 commit into
lance-format:mainfrom
geruh:deletes-engine-path

Conversation

@geruh

@geruh geruh commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

#10914 added DeletionFile.path to the table format so deletion files can have an explicit location independent of their fragment ID. This PR adds support across commit fragment ID assignment, the session cache, inline deletions, and transaction serialization.

At commit time, new fragments are assigned their final fragment IDs. Fragments with an explicit path or inline deletion bytes can move to a new ID safely, while derived deletion files still embed the fragment ID in their filename so commits now reject them if the ID changes.

In the session cache, explicit deletion files now key by base_id and path, inline vectors key by their bytes, and derived files keep their existing key fields. That avoids stale cache hits across fragment reassignments and inline conversions, and bumps the cache key schema version to 3.

flowchart LR
  W["Write deletion file"] --> C["Commit assigns fragment ID"]
  C -->|"explicit path"| K["Keep path"]
  C -->|"derived path"| F["Reject if ID changed"]
  K --> S["Cache by base_id and path"]
  S --> I["Inline deletions clear path and cache by bytes"]
Loading

Compacting deletions inline clears path and assigns a fresh version and deletion ID, and protobuf transaction conversion validates deletion file locations before encoding.

Testing

  • cargo test -p lance-table --lib and targeted lance tests for deletion caching, inline deletions, explicit-path cleanup, and v0.7.5 migration
  • cargo clippy --no-deps --all-targets -- -D warnings (lance-table, lance) and cargo fmt --check

@github-actions github-actions Bot added A-format On-disk format: protos and format spec docs format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@geruh
geruh force-pushed the deletes-engine-path branch from b02120f to d236826 Compare November 19, 2026 20:28
@geruh geruh changed the title feat(dataset) support explicit deletion file paths in commit cache and cleanup feat(dataset): support explicit deletion file paths in commit cache and cleanup Nov 19, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Nov 19, 2026
@geruh
geruh force-pushed the deletes-engine-path branch from d236826 to 00dd1c3 Compare November 19, 2026 22:47
@geruh
geruh marked this pull request as ready for review November 19, 2026 22:51

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Format specification vote

This PR modifies the Lance format specification, so it requires 3 binding +1 votes from PMC members (excluding the proposer), at least one of them on the latest commit, and a minimum 72-hour voting period, weekends excluded, before it can merge. Vote by approving this PR (+1) or requesting changes (−1, a veto). See the voting process.

Approvals carry over across pushes, so a rebase or a typo fix does not send everyone back to re-vote. Whoever approves the latest commit is vouching that nothing substantive has changed since the earlier approvals; if something has, ask for fresh votes.

Status: ❌ Blocked — 0 of 3 required approvals

Approvals none (0/3)
Latest commit approved by none — one PMC member must approve the latest commit
Vetoes none
Voting period elapsed — ended Tue 2026-11-24 22:51 UTC (14:51 PST)

Updated automatically by the format-spec vote gate, which re-checks every 15 minutes — just voted? Re-check now (press Run workflow; leave the input blank to re-check every open format PR). A PMC member may apply the format-waived label to waive the vote for a trivial edit (typo, wording, formatting).

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Nov 19, 2026
@geruh
geruh force-pushed the deletes-engine-path branch from 00dd1c3 to b410bbf Compare November 19, 2026 23:27
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Nov 19, 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 deletion-cache finding is fixed in b410bbf. Inline vectors now use their encoded contents as cache identity, and repeated conversions preserve the deletion set even when legacy IDs are reused.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 19, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Leaving one blocking question inline on DeletionFileKey regarding explicit deletion file cache identity across snapshots (separate from the already-addressed inline bitmap identity fix).

Small non-blocking rebase note: once rebased onto current main after the lance-table-runtime move, the new tests in cleanup.rs and deletions.rs will need updating to use the current Dataset accessors (e.g., table_state.base / table_state.object_store).

Comment on lines +137 to 141
let location = relative_deletion_file_path(self.fragment_id, self.deletion_file);
match self.deletion_file.base_id {
Some(base_id) => Cow::Owned(format!("deletion/{base_id}/{location}")),
None => Cow::Owned(format!("deletion/{location}")),
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a blocking question from source inspection (runtime impact unverified), separate from the already-addressed inline bitmap identity change:

Explicit deletion file cache keys here (and in write_key below) identify entries by (base_id, path). Because base_paths mappings are manifest-scoped while a Session metadata cache can be shared across dataset versions, could the same base_id and relative path resolve to different storage roots across snapshots and collide in cache?

Could you clarify what invariant keeps (base_id, path) stable across snapshots, or consider scoping explicit deletion cache entries to the resolved base/storage identity so entries from different roots stay isolated?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-format On-disk format: protos and format spec docs enhancement New feature or request format-change A change to the format spec, which requires a vote. Remove if minor (e.g. fixing typo). K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants