Skip to content

Commit

Permalink
chore: Add vlog printings every time we switch global state
Browse files Browse the repository at this point in the history
Should help debugging #1204

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
  • Loading branch information
romange committed May 13, 2023
1 parent 39aed00 commit 860ce49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/server/main_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
Expand Down
10 changes: 0 additions & 10 deletions src/server/server_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -563,16 +563,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;
Expand Down

0 comments on commit 860ce49

Please sign in to comment.