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;