mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-30 03:30:49 +00:00
main: register storage proxy as lifecycle subscriber
In order to be able to act when node joins/leaves, storage proxy is registered as an endpoint lifecycle subscriber. Fixes #3826 Fixes #4028
This commit is contained in:
4
main.cc
4
main.cc
@@ -767,7 +767,9 @@ int main(int ac, char** av) {
|
||||
db::hints::manager::rebalance(cfg->view_hints_directory()).get();
|
||||
|
||||
proxy.invoke_on_all([] (service::storage_proxy& local_proxy) {
|
||||
local_proxy.start_hints_manager(gms::get_local_gossiper().shared_from_this(), service::get_local_storage_service().shared_from_this());
|
||||
auto& ss = service::get_local_storage_service();
|
||||
ss.register_subscriber(&local_proxy);
|
||||
local_proxy.start_hints_manager(gms::get_local_gossiper().shared_from_this(), ss.shared_from_this());
|
||||
}).get();
|
||||
|
||||
supervisor::notify("starting messaging service");
|
||||
|
||||
@@ -1383,7 +1383,8 @@ future<> storage_service::drain_on_shutdown() {
|
||||
ss._sys_dist_ks.invoke_on_all(&db::system_distributed_keyspace::stop).get();
|
||||
slogger.info("Drain on shutdown: system distributed keyspace stopped");
|
||||
|
||||
get_storage_proxy().invoke_on_all([] (storage_proxy& local_proxy) {
|
||||
get_storage_proxy().invoke_on_all([&ss] (storage_proxy& local_proxy) mutable {
|
||||
ss.unregister_subscriber(&local_proxy);
|
||||
return local_proxy.stop_hints_manager();
|
||||
}).get();
|
||||
slogger.info("Drain on shutdown: hints manager is stopped");
|
||||
|
||||
Reference in New Issue
Block a user