mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 18:35:46 +02:00
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:
parent
396cf5f77b
commit
c999072b15
2 changed files with 3 additions and 10 deletions
|
@ -1739,6 +1739,9 @@ GlobalState Service::SwitchState(GlobalState from, GlobalState to) {
|
||||||
lock_guard lk(mu_);
|
lock_guard lk(mu_);
|
||||||
if (global_state_ != from)
|
if (global_state_ != from)
|
||||||
return global_state_;
|
return global_state_;
|
||||||
|
|
||||||
|
VLOG(1) << "Switching state from " << GlobalStateName(from) << " to " << GlobalStateName(to);
|
||||||
|
|
||||||
global_state_ = to;
|
global_state_ = to;
|
||||||
|
|
||||||
pp_.Await([&](ProactorBase*) { ServerState::tlocal()->set_gstate(to); });
|
pp_.Await([&](ProactorBase*) { ServerState::tlocal()->set_gstate(to); });
|
||||||
|
|
|
@ -659,16 +659,6 @@ Future<std::error_code> ServerFamily::Load(const std::string& load_path) {
|
||||||
return {};
|
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();
|
auto& pool = service_.proactor_pool();
|
||||||
|
|
||||||
vector<Fiber> load_fibers;
|
vector<Fiber> load_fibers;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue