Repository navigation
[MOD-17675] Refactor addVector to support reuse flows - #1079
Open
nonirosenfeldredis wants to merge 1 commit into
Open
nonirosenfeldredis wants to merge 1 commit into
nonirosenfeldredis wants to merge 1 commit into
Conversation
Split addVector into addVectorInPlace and addVectorToFlat, and move the single-value branch of updateVectors into updateVectorSingleValue. A single-value update with zero vectors now removes the label instead of inserting from a null blob. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1079 +/- ##
==========================================
- Coverage 97.58% 97.57% -0.01%
==========================================
Files 142 142
Lines 9444 9455 +11
==========================================
+ Hits 9216 9226 +10
- Misses 228 229 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
TieredHNSWIndex::addVectorintoaddVectorInPlaceandaddVectorToFlat(private helpers), leavingaddVectoras the dispatcher.updateVectorsintoupdateVectorSingleValue, and flatten the multi-value reuse branches.updateVectors(label, nullptr, 0)now removes the label (as before the refactor) instead of inserting from a null blob.Test plan
updateVectorsSingleValueZeroVectorsRemovesLabel(async + in-place); verified it crashes without then == 0guard.🤖 Generated with Claude Code
Note
Medium Risk
Touches core tiered HNSW insert/update/delete and async job submission paths; the n==0 fix is localized but insertion refactor affects all add/update entry points.
Overview
Refactors tiered HNSW vector insertion and update so reuse / id-reservation flows are easier to follow, without changing the overall tiering model.
addVectoris now a thin dispatcher: write-in-place work lives inaddVectorInPlace, and flat-buffer enqueue + insert-job creation lives inaddVectorToFlat.updateVectorson single-value indexes delegates to newupdateVectorSingleValue, which handlesn > 1,n == 0, and the single-vector overwrite viaaddVector. Multi-value reuse paths are grouped under onereuseIdOnUpdate && !sqAccumulationStateguard (in-place first, then async whenn > 0).Behavior fix:
updateVectors(label, nullptr, 0)on a single-value index removes the label instead of treating a null blob as an overwrite. A unit test covers async (flat) and in-place (HNSW) cases.Reviewed by Cursor Bugbot for commit 152c478. Bugbot is set up for automated code reviews on this repo. Configure here.