Skip to content

fix(index): harvest zone map seeds from the serving data file - #10003

Merged
BubbleCal merged 4 commits into
mainfrom
yang/fix-zonemap-seed-serving-file
Oct 15, 2026
Merged

BubbleCal merged 4 commits into
mainfrom
yang/fix-zonemap-seed-serving-file

Conversation

@BubbleCal

@BubbleCal BubbleCal commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

After a full-column replacement followed by another replacement of one column, a fragment can retain an older file for its other columns. Index maintenance read that first file's ZoneMap seed even though it no longer supplied the indexed column. A matching query then returned 0 rows instead of 10; an all-NULL replacement returned 3 instead of 13.

Harvest from the file currently serving the index's keyed field, resolving its path and object store through the dataset's base metadata. Resolve the seed name through the file's stored schema and physical column mapping, and verify that the inferred mapping agrees with the actual physical-column count. This preserves field identity across renames and avoids descriptor fields in blob footers shifting the lookup. Nested columns and missing or unverifiable seeds fall back to scanning current values.

Regression coverage compares indexed results with flat scans after optimization and reopening. It includes current seeds, all-NULL values, a current file with no seed, seeds disabled, a shallow clone, nested name collisions, swapped column names, and blob columns before or after indexed fields, including a rename composition. The three original stale-seed cases fail on the base revision and the no-seed control passes.

Validation: all 25 tests in cargo test -p lance --lib zone_map_seed passed. cargo fmt --all and cargo clippy --all --tests --benches -- -D warnings passed on the final code.

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.

@github-actions github-actions Bot added the bug Something isn't working label Oct 15, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

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

This comment was marked as outdated.

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

The remaining blob footer finding is fixed: mismatched mappings now fall back to scanning. All 25 seed tests pass, including the blob placement and rename regressions.

@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 fix—the serving-file lookup and field-identity checks address the stale-seed issue cleanly. I reviewed the replacement, rename, nested-field, and blob paths; all 72 relevant tests passed. Running the new tests against the base implementation reproduced six failures, confirming the regression coverage. LGTM.

@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
@BubbleCal
BubbleCal merged commit a5b2ea5 into main Oct 15, 2026
@BubbleCal
BubbleCal deleted the yang/fix-zonemap-seed-serving-file branch October 15, 2026 13:51
Xuanwo pushed a commit that referenced this pull request Oct 24, 2026
The compat matrix is three recent stable majors plus one beta, and
`_fetch_last_beta_release` filled the beta slot with the newest
pre-release on the index. The release automation bumps main's version in
the same commit that tags and publishes a beta, so once that beta is on
the index it carries the version main is building, and the slot labels
the build's own version as the older build. That is the state right
after every beta release: main builds `14.0.0-beta.19` and the index's
newest pre-release is `14.0.0b19`.

`_fetch_last_beta_release` now picks the newest pre-release older than
the build under test, so the slot is always strictly older than the
version being built. Pre-releases are recognized with
`Version.is_prerelease` instead of a substring search, an index entry
that does not parse is skipped, and when nothing older is available the
slot stays empty instead of falling back to a stable release. Reading
the build's own version needs pylance, which `compat-pair.yml` and
`nightly_run.yml` do not install on the host, so a missing pylance is
reported as that rather than as a failed index query; the slot is then
empty there, and neither workflow's tests read it.

This corrects what the slot means; it does not stop a compat case that
asserts an older build lacks a feature from failing once the first beta
with that feature is older than main. #10011 was such a case, and #10003
fixed it by giving the case a version threshold, which is what any such
case needs regardless of this change. The cost is that a pull request's
compat run no longer reads its data with the most recently published
beta, only with the one before it.

Fixes #10011.

## How was this patch tested

`test_beta_slot_takes_the_newest_release_older_than_the_build` covers
the shapes the index can present: the published beta equal to the build,
a beta newer than the build, versions out of order, a stable release
newer than the betas, an unparseable entry, and nothing older to pin.
Reverting the ordering, the pre-release filter or the parse guard each
turns a case red. `test_beta_slot_measures_against_the_installed_build`
covers the default bound, where `lance.__version__` reports Cargo's
`14.0.0-beta.16` and the index has the normalized `14.0.0b16`. The last
two tests cover a host with no pylance.
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.

2 participants