diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index f83c0d2b5a..f6cf189432 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -666,7 +666,7 @@ DBImpl::Compact(const std::string& table_id) { WaitBuildIndexFinish(); - std::lock_guard index_lock(index_result_mutex_); + const std::lock_guard index_lock(build_index_mutex_); const std::lock_guard merge_lock(flush_merge_compact_mutex_); ENGINE_LOG_DEBUG << "Compacting table: " << table_id;