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
This commit is contained in:
Andrew Kryczka 2018-01-09 12:51:10 -08:00 committed by Facebook Github Bot
parent 46ec52499e
commit 0f0d2ab95a
3 changed files with 8 additions and 8 deletions

View File

@ -947,7 +947,7 @@ class DBImpl : public DB {
// from the same write_thread_ without any locks. // from the same write_thread_ without any locks.
uint64_t logfile_number_; uint64_t logfile_number_;
std::deque<uint64_t> std::deque<uint64_t>
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_; bool log_dir_synced_;
// Without two_write_queues, read and writes to log_empty_ are protected by // 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 // mutex_. Since it is currently updated/read only in write_thread_, it can be

View File

@ -238,11 +238,11 @@ void DBImpl::FindObsoleteFiles(JobContext* job_context, bool force,
while (alive_log_files_.begin()->number < min_log_number) { while (alive_log_files_.begin()->number < min_log_number) {
auto& earliest = *alive_log_files_.begin(); auto& earliest = *alive_log_files_.begin();
if (immutable_db_options_.recycle_log_file_num > if (immutable_db_options_.recycle_log_file_num >
log_recycle_files.size()) { log_recycle_files_.size()) {
ROCKS_LOG_INFO(immutable_db_options_.info_log, ROCKS_LOG_INFO(immutable_db_options_.info_log,
"adding log %" PRIu64 " to recycle list\n", "adding log %" PRIu64 " to recycle list\n",
earliest.number); earliest.number);
log_recycle_files.push_back(earliest.number); log_recycle_files_.push_back(earliest.number);
} else { } else {
job_context->log_delete_files.push_back(earliest.number); 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(). // We're just cleaning up for DB::Write().
assert(job_context->logs_to_free.empty()); assert(job_context->logs_to_free.empty());
job_context->logs_to_free = logs_to_free_; job_context->logs_to_free = logs_to_free_;
job_context->log_recycle_files.assign(log_recycle_files.begin(), job_context->log_recycle_files.assign(log_recycle_files_.begin(),
log_recycle_files.end()); log_recycle_files_.end());
logs_to_free_.clear(); logs_to_free_.clear();
} }

View File

@ -1215,9 +1215,9 @@ Status DBImpl::SwitchMemtable(ColumnFamilyData* cfd, WriteContext* context) {
} }
uint64_t recycle_log_number = 0; uint64_t recycle_log_number = 0;
if (creating_new_log && immutable_db_options_.recycle_log_file_num && if (creating_new_log && immutable_db_options_.recycle_log_file_num &&
!log_recycle_files.empty()) { !log_recycle_files_.empty()) {
recycle_log_number = log_recycle_files.front(); recycle_log_number = log_recycle_files_.front();
log_recycle_files.pop_front(); log_recycle_files_.pop_front();
} }
uint64_t new_log_number = uint64_t new_log_number =
creating_new_log ? versions_->NewFileNumber() : logfile_number_; creating_new_log ? versions_->NewFileNumber() : logfile_number_;