Skip to content

[core][flink] Pin DV vector-search read path to the plan snapshot - #8946

Open
XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:fix/dv-vector-search-snapshot-pinning
Open

[core][flink] Pin DV vector-search read path to the plan snapshot#8946
XiaoHongbo-Hope wants to merge 2 commits into
apache:masterfrom
XiaoHongbo-Hope:fix/dv-vector-search-snapshot-pinning

Conversation

@XiaoHongbo-Hope

Copy link
Copy Markdown
Contributor

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-deletion compaction renumbers row-ids (drops
DV-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

  • Add VectorScan.Plan.snapshot() (default null) carrying the snapshot the plan
    was built against.
  • Pin GlobalIndexLiveRowFilter and DataEvolutionGlobalIndexScanner to that
    snapshot so index scan, live-row filtering, and read all observe one consistent
    row-id space.
  • Thread the pinned snapshot through the data-evolution and Flink read drivers.

Tests

VectorSearchBuilderTest#testVectorSearchPinsLiveRowFilterToPlanSnapshot: plans at
S0, commits deletion vectors to reach S1, then reads with the S0 plan and asserts
the row survives. Fails without the pin.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant