in db_stats_logger.cc, hold mutex_ while accessing versions_

Summary:

as subject

Test Plan:db_test

Reviewers: dhruba
main
heyongqiang 12 years ago
parent d3759ca121
commit 690bf88682
  1. 9
      db/db_stats_logger.cc

@ -53,14 +53,10 @@ void DBImpl::LogDBDeployStats() {
return;
}
mutex_.Unlock();
std::string version_info;
version_info += boost::lexical_cast<std::string>(kMajorVersion);
version_info += ".";
version_info += boost::lexical_cast<std::string>(kMinorVersion);
std::string data_dir;
env_->GetAbsolutePath(dbname_, &data_dir);
uint64_t file_total_size = 0;
uint32_t file_total_num = 0;
@ -75,8 +71,13 @@ void DBImpl::LogDBDeployStats() {
const char* file_size_summary = versions_->LevelDataSizeSummary(
&scratch);
std::string data_size_per_level(file_num_summary);
mutex_.Unlock();
int64_t unix_ts;
env_->GetCurrentTime(&unix_ts);
std::string data_dir;
env_->GetAbsolutePath(dbname_, &data_dir);
logger_->Log_Deploy_Stats(version_info, host_name_,
data_dir, file_total_size, file_total_num, file_num_per_level,

Loading…
Cancel
Save