-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: HNSW schema deleting document crash #4987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
1e05c24
322d8a4
0ba68b9
2f2fc92
d9233c8
ed57a37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2722,4 +2722,16 @@ TEST_F(SearchFamilyTest, JsonWithNullFields) { | |
AreDocIds("doc:1", "doc:2")); | ||
} | ||
|
||
TEST_F(SearchFamilyTest, TestTwoHsetDocumentCreationCrashes) { | ||
EXPECT_EQ(Run({"FT.CREATE", "idx", "SCHEMA", "n", "NUMERIC", "v", "VECTOR", "HNSW", "8", "TYPE", | ||
"FLOAT16", "DIM", "4", "DISTANCE_METRIC", "L2", "M", "65536"}), | ||
"OK"); | ||
|
||
auto res = Run({"HSET", "doc", "n", "0"}); | ||
EXPECT_EQ(res, 1); | ||
|
||
res = Run({"HSET", "doc", "n", "1"}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's during removal, I assume if we call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, correct. I checked it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
EXPECT_EQ(res, 0); | ||
} | ||
|
||
} // namespace dfly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I understand. What call exactly throws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now I understand, I think this should be improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exception occurs inside the library:
third_party/libs/hnswlib/include/hnswlib/hnswalg.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it's a legitimate flow. so we should protect ourselves and there is no reason for WARNING.
So at least I would move throw/catch into
dfly::search::HnswlibAdapter::Remove
and remove any logsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed