mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix: review fixed
This commit is contained in:
parent
0ba68b9cae
commit
2f2fc92a0d
3 changed files with 11 additions and 12 deletions
|
@ -281,7 +281,10 @@ struct HnswlibAdapter {
|
|||
}
|
||||
|
||||
void Remove(DocId id) {
|
||||
world_.markDelete(id);
|
||||
try {
|
||||
world_.markDelete(id);
|
||||
} catch (const std::exception& e) {
|
||||
}
|
||||
}
|
||||
|
||||
vector<pair<float, DocId>> Knn(float* target, size_t k, std::optional<size_t> ef) {
|
||||
|
|
|
@ -322,14 +322,10 @@ void ShardDocIndex::RemoveDoc(string_view key, const DbContext& db_cntx, const P
|
|||
if (!indices_)
|
||||
return;
|
||||
|
||||
try {
|
||||
auto accessor = GetAccessor(db_cntx, pv);
|
||||
auto id = key_index_.Remove(key);
|
||||
if (id) {
|
||||
indices_->Remove(id.value(), *accessor);
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
LOG(WARNING) << "Exception while removing document " << key << ": " << e.what();
|
||||
auto accessor = GetAccessor(db_cntx, pv);
|
||||
auto id = key_index_.Remove(key);
|
||||
if (id) {
|
||||
indices_->Remove(id.value(), *accessor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2722,7 +2722,7 @@ TEST_F(SearchFamilyTest, JsonWithNullFields) {
|
|||
AreDocIds("doc:1", "doc:2"));
|
||||
}
|
||||
|
||||
TEST_F(SearchFamilyTest, TestTwoHsetDocumentCreationCrashes) {
|
||||
TEST_F(SearchFamilyTest, TestHsetDeleteDocumentHnswSchemaCrash) {
|
||||
EXPECT_EQ(Run({"FT.CREATE", "idx", "SCHEMA", "n", "NUMERIC", "v", "VECTOR", "HNSW", "8", "TYPE",
|
||||
"FLOAT16", "DIM", "4", "DISTANCE_METRIC", "L2", "M", "65536"}),
|
||||
"OK");
|
||||
|
@ -2730,8 +2730,8 @@ TEST_F(SearchFamilyTest, TestTwoHsetDocumentCreationCrashes) {
|
|||
auto res = Run({"HSET", "doc", "n", "0"});
|
||||
EXPECT_EQ(res, 1);
|
||||
|
||||
res = Run({"HSET", "doc", "n", "1"});
|
||||
EXPECT_EQ(res, 0);
|
||||
res = Run({"DEL", "doc"});
|
||||
EXPECT_EQ(res, 1);
|
||||
}
|
||||
|
||||
} // namespace dfly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue