diff --git a/main.cc b/main.cc index efe0ff40e1a7..062a8feec9e5 100644 --- a/main.cc +++ b/main.cc @@ -1313,7 +1313,7 @@ int main(int ac, char** av) { db.revert_initial_system_read_concurrency_boost(); }).get(); - cql_transport::controller cql_server_ctl(auth_service, mm_notifier, gossiper.local(), qp, service_memory_limiter, sl_controller, lifecycle_notifier, *cfg); + cql_transport::controller cql_server_ctl(auth_service, mm_notifier, gossiper, qp, service_memory_limiter, sl_controller, lifecycle_notifier, *cfg); ss.local().register_protocol_server(cql_server_ctl); diff --git a/transport/controller.cc b/transport/controller.cc index daf2fc5ffa57..d5eff565f317 100644 --- a/transport/controller.cc +++ b/transport/controller.cc @@ -34,7 +34,7 @@ namespace cql_transport { static logging::logger logger("cql_server_controller"); controller::controller(sharded& auth, sharded& mn, - gms::gossiper& gossiper, sharded& qp, sharded& ml, + sharded& gossiper, sharded& qp, sharded& ml, sharded& sl_controller, sharded& elc_notif, const db::config& cfg) : _ops_sem(1) @@ -155,7 +155,7 @@ future<> controller::do_start_server() { } } - cserver->start(std::ref(_qp), std::ref(_auth_service), std::ref(_mem_limiter), cql_server_config, std::ref(cfg), std::ref(_sl_controller)).get(); + cserver->start(std::ref(_qp), std::ref(_auth_service), std::ref(_mem_limiter), cql_server_config, std::ref(cfg), std::ref(_sl_controller), std::ref(_gossiper)).get(); auto on_error = defer([&cserver] { cserver->stop().get(); }); subscribe_server(*cserver).get(); @@ -235,7 +235,7 @@ future<> controller::unsubscribe_server(sharded& server) { } future<> controller::set_cql_ready(bool ready) { - return _gossiper.add_local_application_state(gms::application_state::RPC_READY, gms::versioned_value::cql_ready(ready)); + return _gossiper.local().add_local_application_state(gms::application_state::RPC_READY, gms::versioned_value::cql_ready(ready)); } } // namespace cql_transport diff --git a/transport/controller.hh b/transport/controller.hh index 30b4a7ee2b63..ae4071202082 100644 --- a/transport/controller.hh +++ b/transport/controller.hh @@ -52,7 +52,7 @@ class controller : public protocol_server { sharded& _auth_service; sharded& _mnotifier; sharded& _lifecycle_notifier; - gms::gossiper& _gossiper; + sharded& _gossiper; sharded& _qp; sharded& _mem_limiter; sharded& _sl_controller; @@ -66,7 +66,7 @@ class controller : public protocol_server { future<> unsubscribe_server(sharded& server); public: - controller(sharded&, sharded&, gms::gossiper&, + controller(sharded&, sharded&, sharded&, sharded&, sharded&, sharded&, sharded&, const db::config& cfg); diff --git a/transport/server.cc b/transport/server.cc index f21b79c2c049..834a29b77f5a 100644 --- a/transport/server.cc +++ b/transport/server.cc @@ -152,7 +152,8 @@ event::event_type parse_event_type(const sstring& value) } cql_server::cql_server(distributed& qp, auth::service& auth_service, - service::memory_limiter& ml, cql_server_config config, const db::config& db_cfg, qos::service_level_controller& sl_controller) + service::memory_limiter& ml, cql_server_config config, const db::config& db_cfg, + qos::service_level_controller& sl_controller, gms::gossiper& g) : server("CQLServer", clogger) , _query_processor(qp) , _config(config) @@ -162,6 +163,7 @@ cql_server::cql_server(distributed& qp, auth::service& au , _notifier(std::make_unique()) , _auth_service(auth_service) , _sl_controller(sl_controller) + , _gossiper(g) { namespace sm = seastar::metrics; diff --git a/transport/server.hh b/transport/server.hh index 1e4239a0317f..9ad4bd34c23e 100644 --- a/transport/server.hh +++ b/transport/server.hh @@ -66,6 +66,10 @@ namespace qos { class service_level_controller; } // namespace qos +namespace gms { + class gossiper; +} + namespace cql_transport { class request_reader; @@ -168,12 +172,14 @@ private: transport_stats _stats = {}; auth::service& _auth_service; qos::service_level_controller& _sl_controller; + gms::gossiper& _gossiper; public: cql_server(distributed& qp, auth::service&, service::memory_limiter& ml, cql_server_config config, const db::config& db_cfg, - qos::service_level_controller& sl_controller); + qos::service_level_controller& sl_controller, + gms::gossiper& g); public: using response = cql_transport::response; service::endpoint_lifecycle_subscriber* get_lifecycle_listener() const noexcept;