From 0b310c471ca9b106b10e60132647e7bb82632762 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Thu, 30 Nov 2023 13:57:41 +0200 Subject: [PATCH] service_level_controller: use locator::topology rather than fb_utilities Expose cql3::query_processor in auth::service to get to the topology via storage_proxy.replica::database Signed-off-by: Benny Halevy --- auth/service.hh | 4 ++++ cql3/query_processor.hh | 4 ++++ service/qos/service_level_controller.cc | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/auth/service.hh b/auth/service.hh index 3f26a192d3..8fd4e03d6d 100644 --- a/auth/service.hh +++ b/auth/service.hh @@ -161,6 +161,10 @@ public: return *_role_manager; } + const cql3::query_processor& query_processor() const noexcept { + return _qp; + } + private: future has_existing_legacy_users() const; diff --git a/cql3/query_processor.hh b/cql3/query_processor.hh index c9e199c210..4336106b04 100644 --- a/cql3/query_processor.hh +++ b/cql3/query_processor.hh @@ -160,6 +160,10 @@ public: return _cql_config; } + const service::storage_proxy& proxy() const noexcept { + return _proxy; + } + service::storage_proxy& proxy() { return _proxy; } diff --git a/service/qos/service_level_controller.cc b/service/qos/service_level_controller.cc index 67dec84d22..64d3c82a44 100644 --- a/service/qos/service_level_controller.cc +++ b/service/qos/service_level_controller.cc @@ -12,7 +12,8 @@ #include "service_level_controller.hh" #include "message/messaging_service.hh" #include "db/system_distributed_keyspace.hh" -#include "utils/fb_utilities.hh" +#include "cql3/query_processor.hh" +#include "service/storage_proxy.hh" namespace qos { static logging::logger sl_logger("service_level_controller"); @@ -432,7 +433,8 @@ future<> service_level_controller::do_remove_service_level(sstring name, bool re void service_level_controller::on_join_cluster(const gms::inet_address& endpoint) { } void service_level_controller::on_leave_cluster(const gms::inet_address& endpoint) { - if (this_shard_id() == global_controller && endpoint == utils::fb_utilities::get_broadcast_address()) { + auto my_address = _auth_service.local().query_processor().proxy().local_db().get_token_metadata().get_topology().my_address(); + if (this_shard_id() == global_controller && endpoint == my_address) { _global_controller_db->dist_data_update_aborter.request_abort(); } }