Skip to content

fix(index): reject mixed row domains in scalar index segments - #10004

Merged
LuQQiu merged 3 commits into
mainfrom
yang/fix-staged-index-row-domains
Oct 15, 2026
Merged

LuQQiu merged 3 commits into
mainfrom
yang/fix-staged-index-row-domains

Conversation

@BubbleCal

@BubbleCal BubbleCal commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Staged commits can combine legacy B-tree segments containing row IDs with current segments containing row addresses under the same index name. The logical reader treats every result as belonging to its first segment's domain, silently losing matches on stable-row-ID tables.

Validate the final set of segments when building a CreateIndex manifest, including retained siblings and retried commits. Also reject mixed domains when constructing a logical scalar index. Replacing every segment in one commit remains supported; the format and valid legacy readers are unchanged.

Regression coverage uses a checked-in dataset written by v14.0.0-beta.15. It covers partial migrations in both directions, incoming segment order, direct transactions, logical reader construction, unchanged manifests after rejection, NULL queries, and complete replacement. The five commit regressions fail before the fix. The partial-merge regression uses the same released fixture to verify that legacy segments outside the requested merge window also join the rebuild.

Validation: all 7 regression cases, 9 B-tree maintenance tests, 15 existing staged-commit tests, 21 logical-scalar tests, and 235 transaction tests passed. cargo fmt --all and cargo clippy --all --tests --benches -- -D warnings passed. uv run make build, uv run make lint, and the historical fixture generator's Ruff checks passed.

The B-tree compatibility fixture now distinguishes the beta.16 reader capability from the peer-environment role. It preserves the existing post-compaction query checks, then restores index coverage for capable readers before checking the next reader. Both old-reader scan fallback and supported-reader index usage remain enforced.

The identical Python change passed 9 harness regression cases and 8 downgrade/round-trip cases using published 0.39.0, 13.0.0, 14.0.0b15, and 14.0.0b16 readers. uv run make lint passed. Both PRs have the same Python source and dependency tree; CI validates each native build separately.

@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 repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

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

Enforcing a single result domain at the final manifest boundary fits the existing reader contract and leaves complete rebuilds as a safe migration path. Homogeneous legacy segments retain their read behavior.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 15, 2026

@zhangyue19921010 zhangyue19921010 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice Catch~ LGTM
We can land it after ci passed.

@github-actions github-actions Bot added the A-python Python bindings label Oct 15, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 15, 2026
@LuQQiu
LuQQiu merged commit 5aab4c0 into main Oct 15, 2026
@LuQQiu
LuQQiu deleted the yang/fix-staged-index-row-domains branch October 15, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants