Skip to content

Commit

Permalink
unpoint yakushima storages directly before calling yakushima::fin if …
Browse files Browse the repository at this point in the history
…TSURUGI_FAST_SHUTDOWN is set
  • Loading branch information
ban-nobuhiro committed Aug 25, 2023
1 parent 6ff8725 commit aa5fbd1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/concurrency_control/interface/shut_down.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ void fin([[maybe_unused]] bool force_shut_down_logging) try {
#endif
VLOG(log_debug_timing_event) << log_location_prefix_timing_event
<< "shutdown:start_delete_all_records";
auto* fast_shutdown = std::getenv("TSURUGI_FAST_SHUTDOWN");
if (fast_shutdown != nullptr && std::strcmp(fast_shutdown, "1") == 0) {
auto* fast_shutdown_envstr = std::getenv("TSURUGI_FAST_SHUTDOWN");
bool fast_shutdown = fast_shutdown_envstr != nullptr
&& std::strcmp(fast_shutdown_envstr, "1") == 0;
if (fast_shutdown) {
LOG(INFO) << log_location_prefix << "skipped delete_all_records";
} else {
delete_all_records(); // This should be before wp::fin();
Expand All @@ -115,6 +117,10 @@ void fin([[maybe_unused]] bool force_shut_down_logging) try {
// about index
VLOG(log_debug_timing_event) << log_location_prefix_timing_event
<< "shutdown:start_shutdown_yakushima";
if (fast_shutdown) {
yakushima::storage::get_storages()->store_root_ptr(nullptr);
LOG(INFO) << log_location_prefix << "skipping yakushima destroy";
}
yakushima::fin();
VLOG(log_debug_timing_event) << log_location_prefix_timing_event
<< "shutdown:end_shutdown_yakushima";
Expand Down

0 comments on commit aa5fbd1

Please sign in to comment.