Conversation
commit_existing_index_segments compared only index_details.type_url across segments, so vector segments built with different distance metrics (or dimensions, sub-index types, quantizer kinds) could be committed as one logical index. Scan planning derives the metric from the first segment and applies it to the whole logical index, silently ranking the rest under the wrong metric. Validate the coexisting segment set — incoming segments plus retained existing segments, after replacement selection — with the same validate_vector_query_compatibility check the query path requires, opening each segment via a new open_vector_index_from_metadata helper that does not require the segment to be committed yet. A complete replacement may still change the metric because replaced segments no longer constrain the set.
rustls 0.23.40 is flagged by RUSTSEC-2026-0285 (TLS 1.3 handshake messages accepted across encryption level boundaries); 0.23.45 is the fix release. Refresh all three lockfiles; the root lockfile also picks up the required aws-lc-rs 1.18.1 / aws-lc-sys 0.45.0 bump.
Backport of the compat-harness change from lance-format#8903 (1391e6c). pylance 12.0.0 (released 2026-09-17) and the 13.0.0 betas depend on lance-namespace>=0.11.1,<0.12, which conflicts with the harness's lance-namespace>=0.8.0,<0.9 pin: venv creation for those versions fails pip resolution, failing every [12.0.0]/[13.0.0b4] compat case and every index-maintenance sequence shard (its newer ref resolved to 12.0.0 as soon as it hit PyPI), which alone burns the 60-minute Compatibility Tests budget. Not caused by the index fix in this PR; backported to unblock compat CI on release/v11.0 (the fix already lives on main).
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The commit boundary now validates the authoritative query contract across incoming and retained vector segments after replacement selection, so incompatible logical indices are rejected before publication while full replacements may still change metrics. The synchronized rustls backport matches #9212, and the compatibility-harness change is the release-line backport of #8903. No blocking issues remain.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dataset::commit_existing_index_segmentsvalidated onlyindex_details.type_urlacross the segment set, so vector segments built with different distance metrics (or dimensions, sub-index types, or quantizer kinds) could be committed as one logical index. Scan planning derives the metric from the first segment and applies it to the whole logical index, so the remaining segments would be searched and ranked under the wrong metric — silently returning incorrect nearest-neighbor results.Reproduced via the distributed build loop (the path lance-c's
lance_dataset_commit_index_segmentsbinds): build fragment 0 as IVF_FLAT/L2 and fragment 1 as IVF_FLAT/Cosine, then commit both metadata blobs — the commit succeeds atab6b5bbe.Surfaced during review of lance-format/lance-c#84.
Fix
After replacement selection, validate the coexisting segment set — incoming segments plus retained existing segments — with the same
validate_vector_query_compatibilitycheck the query/optimize paths already require (metric, dimension, sub-index type, quantizer kind; independently trained IVF centroids and PQ codebooks may still differ). Incompatible sets are rejected withInvalidInputbefore any manifest change, so the dataset version and existing index are untouched.Because incoming segments are not in the manifest yet, the validation opens each segment through a new
Dataset::open_vector_index_from_metadatahelper —DatasetIndexInternalExt::open_vector_indexminus the manifestload_indexlookup, extracted mechanically with no behavior change for committed segments.A complete replacement may still change the metric: replaced segments are no longer part of the coexisting set, so they impose no constraint.
Tests
Three new tests in
rust/lance/src/index/vector/ivf/v2.rs:test_commit_existing_index_segments_commits_multiple_segmentspreviously committed metadata-only fake segments (payloadb"seg0"); since compatibility validation now opens coexisting segments, it builds real IVF segments viaexecute_uncommittedinstead — same assertions otherwise.cargo test -p lance --lib: 3069 passed, 0 failedcargo clippy -p lance --lib --tests: cleanTargeting
release/v11.0so lance-c can pin a v11-line revision containing the fix (its current pinab6b5bbe= v11.0.0). Happy to forward-port tomainif you'd like it there first.Supersedes #9351 (same commits): that PR picked up a stale
format-changelabel while it briefly targetedmain, so theformat-spec-votegate blocks it until a PMC member relabels or votes — this diff touches no format files.