Skip to content

Commit

Permalink
Fix formatting and an assert status checked bug
Browse files Browse the repository at this point in the history
  • Loading branch information
anand1976 committed Apr 26, 2024
1 parent e127200 commit af97791
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions db/db_impl/db_impl_files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ uint64_t DBImpl::MinLogNumberToKeep() {
return versions_->min_log_number_to_keep();
}

uint64_t DBImpl::MinLogNumberToRecycle() {
return min_log_number_to_recycle_;
}
uint64_t DBImpl::MinLogNumberToRecycle() { return min_log_number_to_recycle_; }

uint64_t DBImpl::MinObsoleteSstNumberToKeep() {
mutex_.AssertHeld();
Expand Down Expand Up @@ -302,8 +300,8 @@ 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() && alive_log_files_.begin()->number >=
MinLogNumberToRecycle()) {
log_recycle_files_.size() &&
alive_log_files_.begin()->number >= MinLogNumberToRecycle()) {
ROCKS_LOG_INFO(immutable_db_options_.info_log,
"adding log %" PRIu64 " to recycle list\n",
earliest.number);
Expand Down
4 changes: 2 additions & 2 deletions db/db_write_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -925,11 +925,11 @@ TEST_P(DBWriteTest, RecycleLogToggleTest) {
Reopen(options);
// 1.log is added to alive_log_files_
ASSERT_OK(Put(Key(2), "val1"));
Flush();
ASSERT_OK(Flush());
// 1.log should be deleted and not recycled, since it
// was created by the previous Reopen
ASSERT_OK(Put(Key(1), "val2"));
Flush();
ASSERT_OK(Flush());

options.recycle_log_file_num = 1;
Reopen(options);
Expand Down

0 comments on commit af97791

Please sign in to comment.