[core][flink] Pin DV vector-search read path to the plan snapshot - #8946
Open
XiaoHongbo-Hope wants to merge 2 commits into
Open
[core][flink] Pin DV vector-search read path to the plan snapshot#8946XiaoHongbo-Hope wants to merge 2 commits into
XiaoHongbo-Hope wants to merge 2 commits into
Conversation
On a deletion-vector table, a vector search plans its index scan at one snapshot (row-ids A) but the live-row filter and downstream reads resolved at the latest snapshot. If a materialize-deletion compaction renumbered row-ids in between, index row-ids no longer matched the data, yielding wrong or missing rows. Thread the plan snapshot through VectorScan.Plan.snapshot() and pin the live-row filter and the data-evolution global-index scanner to it, so index scan, live-row filtering, and read all observe one consistent row-id space. Adds testVectorSearchPinsLiveRowFilterToPlanSnapshot, which fails without the pin.
Fold the pinned-snapshot parameter into the existing DataEvolutionGlobalIndexScanner.create() signature rather than keeping a separate overload.
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.
Purpose
On a deletion-vector (DV) enabled table, a vector search plans its global-index
scan at one snapshot but resolved the live-row filter and downstream reads at the
latest snapshot. A
materialize-deletioncompaction renumbers row-ids (dropsDV-deleted rows and rewrites files). If one commits between plan and read, the
index's row-ids (numbering A) no longer map to the data (numbering B), so the
search returns wrong or missing rows.
This is latent on master today (index build on DV tables is currently blocked),
but becomes reachable once building Lumina indexes on DV tables is allowed. It is
a self-contained read-path fix and is submitted independently.
Change
VectorScan.Plan.snapshot()(defaultnull) carrying the snapshot the planwas built against.
GlobalIndexLiveRowFilterandDataEvolutionGlobalIndexScannerto thatsnapshot so index scan, live-row filtering, and read all observe one consistent
row-id space.
Tests
VectorSearchBuilderTest#testVectorSearchPinsLiveRowFilterToPlanSnapshot: plans atS0, commits deletion vectors to reach S1, then reads with the S0 plan and asserts
the row survives. Fails without the pin.