Skip to content

fix(index): conflict CreateIndex with a DataReplacement of a packed parent - #10341

Merged
Xuanwo merged 6 commits into
lance-format:mainfrom
easyrev:fix/packed-parent-index-conflict
Oct 29, 2026
Merged

Xuanwo merged 6 commits into
lance-format:mainfrom
easyrev:fix/packed-parent-index-conflict

Conversation

@easyrev

@easyrev easyrev commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

A DataReplacement of a packed struct rewrites the file that holds its children. The CreateIndex rebase check compared field ids directly, so an index on s.x could commit over a concurrent replacement of s and return stale rows.

The check now uses field_affects_index with the read schema. A replacement of a packed parent conflicts with an index on any of its children. The conflict is retryable, the same as a direct replacement of the indexed field.

Behavior change: in this race, create_index and commit_existing_index_segments now return a retryable conflict instead of committing a stale index.

Tests

The new tests are in concurrent_reindex.rs, which already has the commit-race helpers.

  • A create_index on s.x and a staged segment committed with commit_existing_index_segments, each racing a DataReplacement of s with no compaction. On main both commit, and the index returns 0 rows for s.x = 333 where a scan returns 1. With this change both fail with a retryable conflict.
  • Control: a merge_insert with RewriteColumns on the same row returns correct rows before and after this change.
  • Conflict resolver tests: 146 passed. index:: tests: 1,590 passed, 1 ignored. cargo clippy -p lance --tests -- -D warnings passes.

I found this while working on #10096. It is a separate bug.

Fixes #10340

@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 added the bug Something isn't working label Oct 26, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-changes Latest Gatekeeper recommendation requests changes. and removed K-changes Latest Gatekeeper recommendation requests changes. labels Oct 26, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Oct 26, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 26, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 26, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 27, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 27, 2026
@wjones127 wjones127 added the critical-fix Bugs that cause crashes, security vulnerabilities, or incorrect data. label Oct 29, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 29, 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.

Packed-parent replacements correctly conflict with child-field index commits, while unrelated-column replacements remain compatible. The staged-index scaling fix remains intact.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 29, 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.

LGTM.

@Xuanwo
Xuanwo merged commit bc513ab into lance-format:main Oct 29, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working critical-fix Bugs that cause crashes, security vulnerabilities, or incorrect data. K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: CreateIndex on a packed struct child commits over a concurrent DataReplacement of the parent, and the index returns stale rows

3 participants