-
Notifications
You must be signed in to change notification settings - Fork 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
Conversation
src/server/search/doc_index.cc
Outdated
auto id = key_index_.Remove(key); | ||
if (id) { | ||
indices_->Remove(id.value(), *accessor); | ||
try { |
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.
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 logs
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.
Fixed
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's during removal, I assume if we call DEL doc
it would achieve similar effect? If yes, it's a clearer test, imho.
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, correct. I checked it. DEL doc
archives the same effect. I will change the test.
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.
Fixed
Signed-off-by: Volodymyr Yavdoshenko <volodymyr@dragonflydb.io>
The scenario that caused the crash:
fixes: #4979