From 0f0d2ab95a2107256498e7be2bbd3d4e8c0c7c32 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Tue, 9 Jan 2018 12:51:10 -0800 Subject: [PATCH] fix DBImpl instance variable naming Summary: got confused while reading `FindObsoleteFiles` due to thinking it's a local variable, so renamed it properly Closes https://github.com/facebook/rocksdb/pull/3342 Differential Revision: D6684797 Pulled By: ajkr fbshipit-source-id: a4df0aae1cccce99d4dd4d164aadc85b17707132 --- db/db_impl.h | 2 +- db/db_impl_files.cc | 8 ++++---- db/db_impl_write.cc | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/db/db_impl.h b/db/db_impl.h index 3c64d2589c..91f75701cb 100644 --- a/db/db_impl.h +++ b/db/db_impl.h @@ -947,7 +947,7 @@ class DBImpl : public DB { // from the same write_thread_ without any locks. uint64_t logfile_number_; std::deque - log_recycle_files; // a list of log files that we can recycle + log_recycle_files_; // a list of log files that we can recycle bool log_dir_synced_; // Without two_write_queues, read and writes to log_empty_ are protected by // mutex_. Since it is currently updated/read only in write_thread_, it can be diff --git a/db/db_impl_files.cc b/db/db_impl_files.cc index a854091f65..066bdef557 100644 --- a/db/db_impl_files.cc +++ b/db/db_impl_files.cc @@ -238,11 +238,11 @@ void DBImpl::FindObsoleteFiles(JobContext* job_context, bool force, while (alive_log_files_.begin()->number < min_log_number) { auto& earliest = *alive_log_files_.begin(); if (immutable_db_options_.recycle_log_file_num > - log_recycle_files.size()) { + log_recycle_files_.size()) { ROCKS_LOG_INFO(immutable_db_options_.info_log, "adding log %" PRIu64 " to recycle list\n", earliest.number); - log_recycle_files.push_back(earliest.number); + log_recycle_files_.push_back(earliest.number); } else { job_context->log_delete_files.push_back(earliest.number); } @@ -283,8 +283,8 @@ void DBImpl::FindObsoleteFiles(JobContext* job_context, bool force, // We're just cleaning up for DB::Write(). assert(job_context->logs_to_free.empty()); job_context->logs_to_free = logs_to_free_; - job_context->log_recycle_files.assign(log_recycle_files.begin(), - log_recycle_files.end()); + job_context->log_recycle_files.assign(log_recycle_files_.begin(), + log_recycle_files_.end()); logs_to_free_.clear(); } diff --git a/db/db_impl_write.cc b/db/db_impl_write.cc index 48ea729a85..ac97934f09 100644 --- a/db/db_impl_write.cc +++ b/db/db_impl_write.cc @@ -1215,9 +1215,9 @@ Status DBImpl::SwitchMemtable(ColumnFamilyData* cfd, WriteContext* context) { } uint64_t recycle_log_number = 0; if (creating_new_log && immutable_db_options_.recycle_log_file_num && - !log_recycle_files.empty()) { - recycle_log_number = log_recycle_files.front(); - log_recycle_files.pop_front(); + !log_recycle_files_.empty()) { + recycle_log_number = log_recycle_files_.front(); + log_recycle_files_.pop_front(); } uint64_t new_log_number = creating_new_log ? versions_->NewFileNumber() : logfile_number_;