From aa5fbd1a340c7bc6a97fe425858b1f2cc2ac96ab Mon Sep 17 00:00:00 2001 From: Nobuhiro Ban Date: Thu, 10 Aug 2023 14:33:58 +0900 Subject: [PATCH] unpoint yakushima storages directly before calling yakushima::fin if TSURUGI_FAST_SHUTDOWN is set --- src/concurrency_control/interface/shut_down.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/concurrency_control/interface/shut_down.cpp b/src/concurrency_control/interface/shut_down.cpp index b58b9df9c..12f43776f 100644 --- a/src/concurrency_control/interface/shut_down.cpp +++ b/src/concurrency_control/interface/shut_down.cpp @@ -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(); @@ -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";