Repository navigation
Vector search: empty filter matches nothing, compaction clears the search cache (#8959, #8957) - #8971
Conversation
… the search vector cache (#8959, #8957) vector.neighbors and vector.sparseNeighbors treated a filter option that resolved to no RIDs as no filter, returning records outside it. The SQL layer now answers with an empty result. COMPACT INDEX renumbers vector ids but left the id-keyed search vector cache populated, so searches scored nodes against other records' vectors. The cache is now cleared when the location index is published. Fixes #8959 Fixes #8957
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughVector neighbor functions now return no results when a supplied RID filter resolves to an empty set. Location-index publication also clears the vector search cache. Regression tests cover both changes. ChangesEmpty RID filters
Compaction search cache
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The filter and compaction changes are mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes tighten search filtering and keep cached vectors aligned with records during compaction. No introduced security concern was identified in the inspected paths, but broader access-control and crash-recovery behavior was not fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❓ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 4.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 6 files. (1 skipped: 1 too large.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
|
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 | 0 |
🟢 Coverage 100.00% diff coverage · -5.87% coverage variation
Metric Results Coverage variation ✅ -5.87% coverage variation Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (94cf342) 207763 176046 84.73% Head commit (2bb18f2) 240420 (+32657) 189596 (+13550) 78.86% (-5.87%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#8971) 8 8 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
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.
ReviewBoth fixes are correct in intent and small. I read the diff and the surrounding code, but did not run the tests. #8959 (empty filter returns nothing)
#8957 (clear search cache on publish)
StyleFollows CLAUDE.md conventions (final params, AssertJ style, no new deps, no debug output). Nothing to flag. Overall: LGTM modulo adding the sparse test, and consider moving the empty-filter return after index resolution. |
…d the sparseNeighbors regression test (#8959)
Review of #8971Both fixes look correct and are tightly scoped. The empty-filter change closes a real tenant-isolation hole (an empty subquery silently turning into an unfiltered search), and the cache clear matches how the id-keyed cache is already invalidated elsewhere. No blocking issues. Notes below. #8959 - empty filter
#8957 - cache clear on publish
Tests
Behaviour change to flagAnyone relying on Overall: LGTM, with the optional follow-ups above. |
…r nested-empty and null-only filters (#8959)
ReviewOverall: both fixes are small, targeted and correct as far as I can tell. No blockers. #8959 (empty filter)
#8957 (search cache)
Tests
LGTM modulo the |
|
Review Overall this is a clean, well-scoped fix for both issues. Both regression tests are described as failing without the fix, and the guard sits at the right point. #8959 (empty filter)
#8957 (search cache after compaction)
Tests
Style / CLAUDE.md
Nothing blocking from my side; the main thing worth a reply is the cache-clear vs. rebuild warm-up and the in-flight search question. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8971 +/- ##
=========================================
Coverage 76.51% 76.52%
+ Complexity 3851 3849 -2
=========================================
Files 2109 2109
Lines 207763 207820 +57
Branches 43824 43845 +21
=========================================
+ Hits 158974 159035 +61
Misses 31756 31756
+ Partials 17033 17029 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #8959
Fixes #8957
vector.neighbors/vector.sparseNeighbors: afilterthat resolves to no RIDs now returns an empty result instead of an unfiltered search (absent filter is unchanged).LSMVectorIndex: the id-keyed search vector cache is cleared when the location index is published, so a renumbering compaction no longer serves other records' vectors.Tests: Issue8959EmptyVectorFilterTest, Issue8957CompactionSearchCacheTest (both fail without the fix); 467 related vector tests pass.
Summary by CodeRabbit