From 0a7f334697e0970c631c565b249c1062203766c8 Mon Sep 17 00:00:00 2001 From: Xu Peng Date: Fri, 24 May 2019 17:30:33 +0800 Subject: [PATCH] feat(db): add archive post merge and build index Former-commit-id: 32678939225459bbfb82d491c53b912633fdb395 --- cpp/src/db/DBImpl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpp/src/db/DBImpl.cpp b/cpp/src/db/DBImpl.cpp index 72b053231b..eee492abbd 100644 --- a/cpp/src/db/DBImpl.cpp +++ b/cpp/src/db/DBImpl.cpp @@ -326,6 +326,10 @@ Status DBImpl::background_merge_files(const std::string& group_id) { merge_files(group_id, kv.first, kv.second); } + if (has_merge) { + _pMeta->archive_files(); + } + try_build_index(); _pMeta->cleanup_ttl_files(1); @@ -362,6 +366,7 @@ Status DBImpl::build_index(const meta::GroupFileSchema& file) { << " from file " << to_remove.file_id; index->Cache(); + _pMeta->archive_files(); return Status::OK(); }