Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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