Repository navigation
fix(#9858): db.index.vector.queryNodes skips candidates a concurrent commit deleted and tops up - #9860
fix(#9858): db.index.vector.queryNodes skips candidates a concurrent commit deleted and tops up#9860blaus23 wants to merge 1 commit into
Conversation
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 8 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The change skips vector candidates whose records were deleted and retries with a larger candidate budget. It is bounded by a cap of 100,000 and covered by regression tests. No concrete merge-blocking risk was identified. Pre-merge checks |
|
…oncurrent commit deleted and tops up The procedure loaded every candidate the index returned with asDocument() and let a RecordNotFoundException escape, so a record deleted between the index search and the load failed the whole query (EntityNotFound over Bolt). It now skips the stale candidate and, when the answer comes up short because of it, asks the indexes again with a doubled candidate budget: the loop vectorNeighbors runs since ArcadeData#9368. It stops when the answer is full, when nothing was skipped, when no index filled its budget, or at 100,000 candidates. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1baf04a to
09c938a
Compare
|
@claude review |
|
Claude finished @robfrank's task in 20s —— View job Review of PR #9860The fix is correct and small. I read the diff of Looks good
Minor, non-blocking
Process notes
No blocking issues found. Approve from my side, subject to green CI. |
What does this PR do?
db.index.vector.queryNodesloaded every candidate the index returned withasDocument()and let aRecordNotFoundExceptionescape. A record deleted between the index search and the load therefore failed the whole query:EntityNotFound: Error executing procedure: db.index.vector.querynodesover Bolt.The procedure now skips a candidate whose record is gone. If skipping leaves the answer short, it asks the indexes again with a doubled candidate budget. This is the same loop
vectorNeighborshas run since #9368. It stops when:vectorNeighborsuses.A search with no stale candidates still makes exactly one pass.
Motivation
The SQL vector functions already skip stale candidates:
vectorNeighbors,vectorRerank,vectorMmr,vectorDiscover,vectorFuseandvectorSparseNeighbors. The Cypher procedure, which Neo4j-compatible clients use, never got the same treatment. With one writer deleting while four clients search, 90 of 81,375 searches failed on a single server (reproduction in #9858).Related issues
Fixes #9858. Same pattern as #9368 (dense, SQL) and #9692 / #9698 (sparse).
Additional Notes
Test.
Issue9858VectorQueryNodesStaleTopUpTestfollows theIssue9368VectorNeighborsStaleTopUpTestsetup: it removes records from the bucket only, leaving their index entries behind. It covers three cases:All three fail without the fix (
RecordNotFoundException) and pass with it.Other verification:
*Vector*and Cypher procedure tests: 1,578/1,578.RecordNotFoundExceptionin the log.Independent of #9857 and its PR; both are based on the same
maincommit.Pre-commit: the hooks that apply to Java files (trailing whitespace, final newline, line endings, BOM) were checked on every changed file.
pre-commititself was not run.Checklist
mvn clean packagecommand. Not the full reactor: I built and installedengineand ran the suites listed above.🤖 Generated with Claude Code
Summary by CodeRabbit