提交 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 ...@@ -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 - \#3406 No debug and info log generated after server started
- \#3407 Server get stuck if create index after entities inserted with no manual flush - \#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 - \#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 - \#3482 Server crashed during adding entities
- \#3490 Fix ut DBTest.DeleteEntitiesTest assert fail
## Feature ## Feature
- \#2319 Redo metadata to support MVCC - \#2319 Redo metadata to support MVCC
......
...@@ -117,11 +117,20 @@ Status ...@@ -117,11 +117,20 @@ Status
MemCollection::Serialize() { MemCollection::Serialize() {
TimeRecorder recorder("MemCollection::Serialize collection " + std::to_string(collection_id_)); TimeRecorder recorder("MemCollection::Serialize collection " + std::to_string(collection_id_));
// apply deleted ids to exist setment files // Operation ApplyDelete need retry if ss stale error found
auto status = ApplyDeleteToFile(); while (true) {
if (!status.ok()) { auto status = ApplyDeleteToFile();
LOG_ENGINE_DEBUG_ << "Failed to apply deleted ids to segment files" << status.message(); if (status.ok()) {
// Note: don't return here, continue serialize mem segments 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 // serialize mem to new segment files
...@@ -146,6 +155,10 @@ MemCollection::Serialize() { ...@@ -146,6 +155,10 @@ MemCollection::Serialize() {
Status Status
MemCollection::ApplyDeleteToFile() { MemCollection::ApplyDeleteToFile() {
if (ids_to_delete_.empty()) {
return Status::OK();
}
// iterate each segment to delete entities // iterate each segment to delete entities
snapshot::ScopedSnapshotT ss; snapshot::ScopedSnapshotT ss;
STATUS_CHECK(snapshot::Snapshots::GetInstance().GetSnapshot(ss, collection_id_)); STATUS_CHECK(snapshot::Snapshots::GetInstance().GetSnapshot(ss, collection_id_));
...@@ -153,9 +166,6 @@ MemCollection::ApplyDeleteToFile() { ...@@ -153,9 +166,6 @@ MemCollection::ApplyDeleteToFile() {
snapshot::OperationContext context; snapshot::OperationContext context;
auto segments_op = std::make_shared<snapshot::CompoundSegmentsOperation>(context, ss); 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; int64_t segment_iterated = 0;
auto segment_executor = [&](const snapshot::SegmentPtr& segment, snapshot::SegmentIterator* iterator) -> Status { auto segment_executor = [&](const snapshot::SegmentPtr& segment, snapshot::SegmentIterator* iterator) -> Status {
segment_iterated++; segment_iterated++;
...@@ -165,11 +175,13 @@ MemCollection::ApplyDeleteToFile() { ...@@ -165,11 +175,13 @@ MemCollection::ApplyDeleteToFile() {
// Step 1: Check delete_id in mem // Step 1: Check delete_id in mem
std::set<idx_t> ids_to_check; std::set<idx_t> ids_to_check;
segment::IdBloomFilterPtr pre_bloom_filter; {
STATUS_CHECK(segment_reader->LoadBloomFilter(pre_bloom_filter)); segment::IdBloomFilterPtr pre_bloom_filter;
for (auto& id : ids_to_delete) { STATUS_CHECK(segment_reader->LoadBloomFilter(pre_bloom_filter));
if (pre_bloom_filter->Check(id)) { for (auto& id : ids_to_delete_) {
ids_to_check.insert(id); if (pre_bloom_filter->Check(id)) {
ids_to_check.insert(id);
}
} }
} }
......
...@@ -187,6 +187,7 @@ Server::Start() { ...@@ -187,6 +187,7 @@ Server::Start() {
#else #else
LOG_SERVER_INFO_ << "CPU edition"; LOG_SERVER_INFO_ << "CPU edition";
#endif #endif
LOG_ENGINE_INFO_ << "Last commit id: " << LAST_COMMIT_ID;
STATUS_CHECK(CpuChecker::CheckCpuInstructionSet()); STATUS_CHECK(CpuChecker::CheckCpuInstructionSet());
#ifdef MILVUS_GPU_VERSION #ifdef MILVUS_GPU_VERSION
STATUS_CHECK(GpuChecker::CheckGpuEnvironment()); STATUS_CHECK(GpuChecker::CheckGpuEnvironment());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册