提交 464927ca 编写于 作者: B BossZou 提交者: Wang Xiangyu

solve conflicts

Signed-off-by: NWang Xiangyu <xy.wang@zilliz.com>
上级 c3f140ed
......@@ -32,7 +32,10 @@ Please mark all changes in change log and use the issue from GitHub
- \#3406 No debug and info log generated after server started
- \#3407 Server get stuck if create index after entities inserted with no manual flush
- \#3446 ListIDInSegment get wrong result when delete more than one ids
- \#3448 RHNSWFlatTest failed
- \#3453 Fix server crashed during stability test
- \#3482 Server crashed during adding entities
- \#3490 Fix ut DBTest.DeleteEntitiesTest assert fail
## Feature
- \#2319 Redo metadata to support MVCC
......
......@@ -117,11 +117,20 @@ Status
MemCollection::Serialize() {
TimeRecorder recorder("MemCollection::Serialize collection " + std::to_string(collection_id_));
// apply deleted ids to exist setment files
auto status = ApplyDeleteToFile();
if (!status.ok()) {
LOG_ENGINE_DEBUG_ << "Failed to apply deleted ids to segment files" << status.message();
// Note: don't return here, continue serialize mem segments
// Operation ApplyDelete need retry if ss stale error found
while (true) {
auto status = ApplyDeleteToFile();
if (status.ok()) {
ids_to_delete_.clear();
break;
} else if (status.code() == SS_STALE_ERROR) {
LOG_ENGINE_ERROR_ << "Failed to apply deleted ids to segment files: file stale. Try again";
continue;
} else {
LOG_ENGINE_ERROR_ << "Failed to apply deleted ids to segment files: " << status.ToString();
// Note: don't return here, continue serialize mem segments
break;
}
}
// serialize mem to new segment files
......@@ -146,6 +155,10 @@ MemCollection::Serialize() {
Status
MemCollection::ApplyDeleteToFile() {
if (ids_to_delete_.empty()) {
return Status::OK();
}
// iterate each segment to delete entities
snapshot::ScopedSnapshotT ss;
STATUS_CHECK(snapshot::Snapshots::GetInstance().GetSnapshot(ss, collection_id_));
......@@ -153,9 +166,6 @@ MemCollection::ApplyDeleteToFile() {
snapshot::OperationContext context;
auto segments_op = std::make_shared<snapshot::CompoundSegmentsOperation>(context, ss);
std::unordered_set<idx_t> ids_to_delete;
ids_to_delete.swap(ids_to_delete_);
int64_t segment_iterated = 0;
auto segment_executor = [&](const snapshot::SegmentPtr& segment, snapshot::SegmentIterator* iterator) -> Status {
segment_iterated++;
......@@ -165,11 +175,13 @@ MemCollection::ApplyDeleteToFile() {
// Step 1: Check delete_id in mem
std::set<idx_t> ids_to_check;
segment::IdBloomFilterPtr pre_bloom_filter;
STATUS_CHECK(segment_reader->LoadBloomFilter(pre_bloom_filter));
for (auto& id : ids_to_delete) {
if (pre_bloom_filter->Check(id)) {
ids_to_check.insert(id);
{
segment::IdBloomFilterPtr pre_bloom_filter;
STATUS_CHECK(segment_reader->LoadBloomFilter(pre_bloom_filter));
for (auto& id : ids_to_delete_) {
if (pre_bloom_filter->Check(id)) {
ids_to_check.insert(id);
}
}
}
......
......@@ -187,6 +187,7 @@ Server::Start() {
#else
LOG_SERVER_INFO_ << "CPU edition";
#endif
LOG_ENGINE_INFO_ << "Last commit id: " << LAST_COMMIT_ID;
STATUS_CHECK(CpuChecker::CheckCpuInstructionSet());
#ifdef MILVUS_GPU_VERSION
STATUS_CHECK(GpuChecker::CheckGpuEnvironment());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册