Skip to content

Commit

Permalink
add wal close log
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Xu <[email protected]>
  • Loading branch information
Qi Xu committed Feb 16, 2024
1 parent 3dba9fa commit 5f62d0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/db_impl/db_impl_files.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ void DBImpl::FindObsoleteFiles(JobContext* job_context, bool force,
// logs_ could have changed while we were waiting.
continue;
}
ROCKS_LOG_INFO(immutable_db_options_.info_log,
"deleting log %" PRIu64 " from logs_\n", log.number);
logs_to_free_.push_back(log.ReleaseWriter());
logs_.pop_front();
}
Expand Down Expand Up @@ -491,6 +493,8 @@ void DBImpl::PurgeObsoleteFiles(JobContext& state, bool schedule_only) {
// Close WALs before trying to delete them.
for (const auto w : state.logs_to_free) {
// TODO: maybe check the return value of Close.
ROCKS_LOG_INFO(immutable_db_options_.info_log,
"Close log %" PRIu64 " from logs_\n", w->get_log_number());
auto s = w->Close();
s.PermitUncheckedError();
}
Expand Down

0 comments on commit 5f62d0e

Please sign in to comment.