fix: PersistentIndex.need_rebuild() should trigger rebuild when index is empty#1244
Open
yc111233 wants to merge 1 commit intovolcengine:mainfrom
Open
fix: PersistentIndex.need_rebuild() should trigger rebuild when index is empty#1244yc111233 wants to merge 1 commit intovolcengine:mainfrom
yc111233 wants to merge 1 commit intovolcengine:mainfrom
Conversation
|
Failed to generate code suggestions for PR |
2 tasks
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.
Bug Description
PersistentIndex.need_rebuild()always returnsFalse, which prevents the index maintenance scheduler from ever rebuilding the index, even when the index is empty but the store contains data.Root Cause
When
upsert_data()is called, it writes to both the store (LevelDB) and attempts to update the FAISS index viaupsert_to_index(). However, for persistent indexes, the C++ FAISS engine can silently fail to write data, resulting in:vector/countAPI returning 0The index maintenance scheduler runs every 30 seconds and calls
_rebuild_indexes_if_needed(), which checksindex.need_rebuild(). SincePersistentIndex.need_rebuild()always returnsFalse, the scheduler never triggers a rebuild, and the index stays permanently empty.Impact
ov reindex --regeneratecompletes but vectors are not searchableFix
Change
PersistentIndex.need_rebuild()to check if the index has zero data entries. When the index is empty, returnTrueto trigger the maintenance scheduler to rebuild from the store.Testing
ov reindex --regeneratecurl http://127.0.0.1:1933/api/v1/stats/memoriesEnvironment