Skip to content

fix: clamp the block-list capacity hint in row_ids_for_mask - #10861

Merged
Xuanwo merged 3 commits into
lance-format:mainfrom
LuciferYang:fix/materialize-index-block-list-capacity
Nov 14, 2026
Merged

Xuanwo merged 3 commits into
lance-format:mainfrom
LuciferYang:fix/materialize-index-block-list-capacity

Conversation

@LuciferYang

@LuciferYang LuciferYang commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10854.

The value is only the initial capacity of the returned Vec, so it now uses saturating_sub. The returned row ids are unchanged: the requested fragments' row ids minus the blocked ones. Draft #8566 has the same one-line change without a test, so whichever lands second can drop that hunk.

How was this patch tested

test_not_equal_filter_on_fragment_subset_legacy_stable_row_ids writes 100 rows in 10 fragments with legacy storage and stable row ids, builds a BTree index, and scans fragment 0 with c != 0. It checks that the plan uses MaterializeIndex and that the scan returns the fragment's 5 matching rows. Without this change it panics.

Integration validation

Merged current main at cdefd7edfc71f91368898d1fec6da789c5f80f5c into the PR branch; the diff against main remains the two files above (+45/-2). On the merged tree:

  • cargo test -p lance --locked --profile ci test_not_equal_filter_on_fragment_subset_legacy_stable_row_ids — 1 passed.
  • cargo test -p lance --lib --locked --profile ci io::exec::scalar_index::tests — 13 passed.
  • cargo test -p lance --lib --locked --profile ci test_btree_nullable_filters_match_unindexed_scan — 1 passed.
  • cargo clippy --profile ci --all --tests --benches --locked -- -D warnings — clean.
  • cargo fmt --all — clean.

The Closes #10854 scope stays the legacy-storage, stable-row-id, fragment-subset negated-index-filter panic described in the issue; the saturating subtraction only protects the capacity hint, and row ids are still filtered by !block_list.contains.

@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 Nov 9, 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 Nov 9, 2026
@wjones127 wjones127 added the critical-fix Bugs that cause crashes, security vulnerabilities, or incorrect data. label Nov 12, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 14, 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 merged revision still removes the fragment-subset panic while preserving which rows the scan returns.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 14, 2026
@Xuanwo
Xuanwo merged commit ed928bb into lance-format:main Nov 14, 2026
44 checks passed
@LuciferYang

Copy link
Copy Markdown
Contributor Author

Thank you @Xuanwo

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: a negated index filter on a fragment subset panics on legacy datasets with stable row ids

3 participants