Repository navigation
fix(#11962): a vector graph build keeps in the delta the live vectors it could not read (commit in flight on a Raft leader) - #11969
Conversation
…ve vectors it could not read - A commit replays its vectors into the location index and the delta before its pages and records are published (on a Raft leader, the whole quorum round trip). A build in that window dropped them like deleted vectors and the post-build trim removed their delta entries, so once the commit completed no search found them until a later rebuild. - The trim now also keeps the entries before the snapshot that the build did not incorporate and that are still live. - Issue11962VectorBuildDuringCommitIT runs a build from TEST_PRE_DISPATCH_HOOK inside a leader commit.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Tick the box to add this pull request to the merge queue (same as
|
Up to standards ✅🟢 Issues
|
… document scan too - On a sparse index the build cross-checks with a document scan and then skipped the recovery from the in-memory locations. The scan cannot see a commit in flight either, so the build published a location index without its vector, and the trim then dropped its delta entry as not live. - Issue11962VectorBuildDuringCommitIT gains the sparse variant (30 vectors among 90 records).
… could not read - A vector the build leaves out by its value (an all-zero COSINE placeholder, a norm the float cosine cannot hold) is live in the location index too, and keeping its delta entry made the delta scan score it as NaN (CI: CosineUnscorableMagnitudeIssue11635Test, ProductQuantizationTest, VectorSearchCorrectnessTest, LSMVectorIndexTest). - The trim now applies the build's own value checks (dimensions, isUnscorable) before keeping an unread entry.
|
On the CI failure of
Each failure is jvector's 0526b8b makes the trim apply the build's own checks (dimensions and
|
|
Validated with the issue's
Committed vectors are no longer missing. The rows without a record are the half of #11962 this PR does not address: a search during the commit window can still answer an in-flight record. The same cluster also passed three 18-minute application runs on this image, one plain, one with a leadership transfer and one with a leader SIGKILL. In each, the cross-node check converged and a deep check of 120 vector/full-text probes found 0 differences. |
|
Triage: Triage of #11969 (fixes the "committed vectors missing from searches" half of #11962). What the change does
Review
The PR deliberately leaves the other half of the issue open, where a search in the window can return an empty row. So #11962 should stay open, or be tracked separately. If the PR body contains |
|
Automated review: approved GitHub triage LGTM, triage clean, sandbox build and tests green. Merge is a maintainer decision.
|
Fixes #11962 (the "committed vectors missing from searches" half).
Problem
A commit replays its vectors into the index's location index and delta buffer during phase 1. Its pages and records are published only in phase 2, which on a Raft leader comes after the quorum round trip. A graph build in that window cannot read those vectors, so validation drops them like deleted ones, and two things then lost them:
On a 3-node cluster with 4 writers and 2 searchers this left 1 to 10 committed vectors out of a k=all search for 15 to 30 s after the writers stopped. During the application's ingests the leader logged the matching pattern (
Recovered N vectors from in-memory index (page-parsed: 0 ...),Page id ... does not exist,Filtered out N vectors with deleted/invalid documents).Change
undoReplay), so what survives is exactly a vector whose commit was in flight. It stays in the delta, where searches score it, and keeps the index MUTABLE so the next build incorporates it. The vector ids of the build are already sorted ascending (the build checks it), so the lookup is a binary search per delta entry.This PR does not address the other half of the issue: a search during the window can still answer the in-flight record as an empty row.
Test
Issue11962VectorBuildDuringCommitIT(ha-raft, 3 nodes) runs a full graph build fromRaftReplicatedDatabase.TEST_PRE_DISPATCH_HOOK, on another thread, while a commit of one new vector is between its replay and its dispatch to Raft. Once the commit completes, the vector must be the top-1 of a search by its own value. There are two variants: a dense index, and a sparse one (30 vectors among 90 records).[#28:29], not[#28:30][#28:29], not[#28:90]The related engine suites pass too, 564 tests in 53 classes. They include all of
com.arcadedb.index.vectorthat covers the delta, the rebuild and the #3722 recovery:VectorTransactionSearchTest,LSMVectorIndexRebuildRacingWritesTest,VectorRebuildLifecycleTest,LSMVectorIndexRecoveryTest,VectorGraphStalenessTest,GroupedVectorSearchTest,VectorPrefilterTest,DeltaScanVectorSearchTest,VectorDeltaScanTest,LSMVectorIndexRebuildTest,LSMVectorIndexCompactionTest,LSMVectorIndexGraph{Connectivity,FileVisibility,Manifest,Storage}Test,VectorGraphPersistTest,VectorIndexRebuildsOnEveryCloseTest,VectorLocationIndexTest,GraphSearcherPoolStaleGraphTest,CompactIndexKeepsGraphReusableTest,PqCodesStaleForRebuiltGraphTestandIssue11805GraphRebuildSyncsOnlyItsFileTest, plus the sparse-vector suites.Follow-up (0526b8b): the first version also kept the delta entries of vectors that the build leaves out because of their value, such as an all-zero placeholder under COSINE or a norm the float cosine cannot hold. Those are live in the location index too, and the delta scan then scored them as NaN. CI caught it in
CosineUnscorableMagnitudeIssue11635Test,ProductQuantizationTest,VectorSearchCorrectnessTestandLSMVectorIndexTest. The trim now applies the build's own value checks (dimensions,isUnscorable) before it keeps an unread entry. Those four classes plusVectorTransactionSearchTest,LSMVectorIndexRebuildRacingWritesTest,VectorRebuildLifecycleTest,LSMVectorIndexRecoveryTestandDeltaScanVectorSearchTestpass (236 tests).