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 <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2023-11-30 13:57:41 +02:00
parent 0e5754adc6
commit 0b310c471c
3 changed files with 12 additions and 2 deletions

View File

@@ -161,6 +161,10 @@ public:
return *_role_manager;
}
const cql3::query_processor& query_processor() const noexcept {
return _qp;
}
private:
future<bool> has_existing_legacy_users() const;

View File

@@ -160,6 +160,10 @@ public:
return _cql_config;
}
const service::storage_proxy& proxy() const noexcept {
return _proxy;
}
service::storage_proxy& proxy() {
return _proxy;
}

View File

@@ -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();
}
}