提交 88720546 编写于 作者: G groot

#1609 Refine Compact function

Signed-off-by: Ngroot <yihua.mo@zilliz.com>
上级 17ec3d5e
...@@ -687,7 +687,10 @@ DBImpl::Compact(const std::string& table_id) { ...@@ -687,7 +687,10 @@ DBImpl::Compact(const std::string& table_id) {
OngoingFileChecker::GetInstance().MarkOngoingFiles(files_to_compact); OngoingFileChecker::GetInstance().MarkOngoingFiles(files_to_compact);
Status compact_status; Status compact_status;
for (auto& file : files_to_compact) { for (meta::TableFilesSchema::iterator iter = files_to_compact.begin(); iter != files_to_compact.end();) {
meta::TableFileSchema file = *iter;
iter = files_to_compact.erase(iter);
// Check if the segment needs compacting // Check if the segment needs compacting
std::string segment_dir; std::string segment_dir;
utils::GetParentPath(file.location_, segment_dir); utils::GetParentPath(file.location_, segment_dir);
...@@ -724,6 +727,8 @@ DBImpl::Compact(const std::string& table_id) { ...@@ -724,6 +727,8 @@ DBImpl::Compact(const std::string& table_id) {
compact_status = status; compact_status = status;
break; // meta error, could not go on break; // meta error, could not go on
} }
OngoingFileChecker::GetInstance().UnmarkOngoingFile(file);
} }
OngoingFileChecker::GetInstance().UnmarkOngoingFiles(files_to_compact); OngoingFileChecker::GetInstance().UnmarkOngoingFiles(files_to_compact);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册