code: Remove global proxy

No code needs global proxy anymore. Keep on-stack values in main and
cql_test_env and keep the pointer on debug:: namespace.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2023-04-21 13:57:23 +03:00
parent f953fb2f52
commit 739455c3aa
5 changed files with 8 additions and 19 deletions

View File

@@ -437,6 +437,7 @@ sharded<streaming::stream_manager> *the_stream_manager;
sharded<gms::feature_service> *the_feature_service;
sharded<gms::gossiper> *the_gossiper;
sharded<locator::snitch_ptr> *the_snitch;
sharded<service::storage_proxy> *the_storage_proxy;
}
static int scylla_main(int ac, char** av) {
@@ -516,7 +517,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
distributed<replica::database> db;
seastar::sharded<service::cache_hitrate_calculator> cf_cache_hitrate_calculator;
service::load_meter load_meter;
auto& proxy = service::get_storage_proxy();
sharded<service::storage_proxy> proxy;
sharded<service::storage_service> ss;
sharded<service::migration_manager> mm;
sharded<tasks::task_manager> task_manager;
@@ -1078,6 +1079,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
engine().update_blocked_reactor_notify_ms(blocked_reactor_notify_ms);
}).get();
debug::the_storage_proxy = &proxy;
supervisor::notify("starting storage proxy");
service::storage_proxy::config spcfg {
.hints_directory_initializer = hints_dir_initializer,

View File

@@ -1993,7 +1993,10 @@ class scylla_memory(gdb.Command):
@staticmethod
def print_coordinator_stats():
sp = sharded(gdb.parse_and_eval('service::_the_storage_proxy')).local()
try:
sp = sharded(gdb.parse_and_eval('debug::the_storage_proxy')).local()
except gdb.error:
sp = sharded(gdb.parse_and_eval('service::_the_storage_proxy')).local()
if not sp:
return
global_sp_stats, per_sg_sp_stats = scylla_memory.summarize_storage_proxy_coordinator_stats(sp)

View File

@@ -805,8 +805,6 @@ private:
}
};
distributed<service::storage_proxy> _the_storage_proxy;
using namespace exceptions;
using fbu = utils::fb_utilities;

View File

@@ -688,18 +688,4 @@ public:
friend class cas_mutation;
};
extern distributed<storage_proxy> _the_storage_proxy;
// DEPRECATED, DON'T USE!
// Pass references to services through constructor/function parameters. Don't use globals.
inline distributed<storage_proxy>& get_storage_proxy() {
return _the_storage_proxy;
}
// DEPRECATED, DON'T USE!
// Pass references to services through constructor/function parameters. Don't use globals.
inline storage_proxy& get_local_storage_proxy() {
return _the_storage_proxy.local();
}
}

View File

@@ -552,7 +552,7 @@ public:
distributed<service::migration_manager> mm;
sharded<service::storage_service> ss;
distributed<db::batchlog_manager> bm;
distributed<service::storage_proxy>& proxy = service::get_storage_proxy();
sharded<service::storage_proxy> proxy;
auto notify_set = init_configurables
? configurable::init_all(*cfg, init_configurables->extensions, service_set(