chore: Add vlog printings every time we switch global state (#1208)

Should help debugging #1204

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2023-05-13 12:57:54 +02:00 committed by GitHub
parent 396cf5f77b
commit c999072b15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View file

@ -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); });

View file

@ -659,16 +659,6 @@ Future<std::error_code> 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<Fiber> load_fibers;