From c999072b15a7935da2dcacf5a831d945d75ac224 Mon Sep 17 00:00:00 2001 From: Roman Gershman Date: Sat, 13 May 2023 12:57:54 +0200 Subject: [PATCH] chore: Add vlog printings every time we switch global state (#1208) Should help debugging #1204 Signed-off-by: Roman Gershman --- src/server/main_service.cc | 3 +++ src/server/server_family.cc | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/server/main_service.cc b/src/server/main_service.cc index f995e900b..f405a24c9 100644 --- a/src/server/main_service.cc +++ b/src/server/main_service.cc @@ -1739,6 +1739,9 @@ GlobalState Service::SwitchState(GlobalState from, GlobalState to) { lock_guard lk(mu_); if (global_state_ != from) return global_state_; + + VLOG(1) << "Switching state from " << GlobalStateName(from) << " to " << GlobalStateName(to); + global_state_ = to; pp_.Await([&](ProactorBase*) { ServerState::tlocal()->set_gstate(to); }); diff --git a/src/server/server_family.cc b/src/server/server_family.cc index 995107ae4..d8fe2a19b 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -659,16 +659,6 @@ Future ServerFamily::Load(const std::string& load_path) { return {}; } -#if 0 - auto& pool = service_.proactor_pool(); - // Deliberately run on all I/O threads to update the state for non-shard threads as well. - pool.Await([&](ProactorBase*) { - // TODO: There can be a bug where status is different. - CHECK(ServerState::tlocal()->gstate() == GlobalState::IDLE); - ServerState::tlocal()->set_gstate(GlobalState::LOADING); - }); -#endif - auto& pool = service_.proactor_pool(); vector load_fibers;