Merge branch 'xupeng-0.3.1' into 'branch-0.3.1'

Add log before bg_error break

See merge request megasearch/milvus!218

Former-commit-id: e76306aa78e9d4d896479c2540c071520279fa22
pull/191/head
peng.xu 2019-07-15 17:30:53 +08:00
commit 4852ca7143
1 changed files with 3 additions and 7 deletions

View File

@ -89,6 +89,7 @@ DBImpl::DBImpl(const Options& options)
meta_ptr_ = DBMetaImplFactory::Build(options.meta, options.mode); meta_ptr_ = DBMetaImplFactory::Build(options.meta, options.mode);
mem_mgr_ = MemManagerFactory::Build(meta_ptr_, options_); mem_mgr_ = MemManagerFactory::Build(meta_ptr_, options_);
if (options.mode != Options::MODE::READ_ONLY) { if (options.mode != Options::MODE::READ_ONLY) {
ENGINE_LOG_INFO << "StartTimerTasks";
StartTimerTasks(); StartTimerTasks();
} }
} }
@ -390,14 +391,11 @@ Status DBImpl::BackgroundMergeFiles(const std::string& table_id) {
} }
void DBImpl::BackgroundCompaction(std::set<std::string> table_ids) { void DBImpl::BackgroundCompaction(std::set<std::string> table_ids) {
// static int b_count = 0;
// b_count++;
// std::cout << "BackgroundCompaction: " << b_count << std::endl;
Status status; Status status;
for (auto& table_id : table_ids) { for (auto& table_id : table_ids) {
status = BackgroundMergeFiles(table_id); status = BackgroundMergeFiles(table_id);
if (!status.ok()) { if (!status.ok()) {
ENGINE_LOG_ERROR << "BGERROR found during merge files!";
bg_error_ = status; bg_error_ = status;
return; return;
} }
@ -408,7 +406,6 @@ void DBImpl::BackgroundCompaction(std::set<std::string> table_ids) {
int ttl = 1; int ttl = 1;
if (options_.mode == Options::MODE::CLUSTER) { if (options_.mode == Options::MODE::CLUSTER) {
ttl = meta::D_SEC; ttl = meta::D_SEC;
// ENGINE_LOG_DEBUG << "Server mode is cluster. Clean up files with ttl = " << std::to_string(ttl) << "seconds.";
} }
meta_ptr_->CleanUpFilesWithTTL(ttl); meta_ptr_->CleanUpFilesWithTTL(ttl);
} }
@ -541,9 +538,9 @@ void DBImpl::BackgroundBuildIndex() {
meta_ptr_->FilesToIndex(to_index_files); meta_ptr_->FilesToIndex(to_index_files);
Status status; Status status;
for (auto& file : to_index_files) { for (auto& file : to_index_files) {
/* ENGINE_LOG_DEBUG << "Buiding index for " << file.location; */
status = BuildIndex(file); status = BuildIndex(file);
if (!status.ok()) { if (!status.ok()) {
ENGINE_LOG_ERROR << "BGERROR found during build index!";
bg_error_ = status; bg_error_ = status;
return; return;
} }
@ -552,7 +549,6 @@ void DBImpl::BackgroundBuildIndex() {
break; break;
} }
} }
/* ENGINE_LOG_DEBUG << "All Buiding index Done"; */
} }
Status DBImpl::DropAll() { Status DBImpl::DropAll() {