migration_manager: Make it main-local

Now everybody is patched to use component-local instance of migration
manager and its global instance can be moved into main() scope.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2021-04-23 14:26:41 +03:00
parent b7a4fb0cf0
commit 13d264d6bd
3 changed files with 3 additions and 13 deletions

View File

@@ -405,6 +405,7 @@ namespace debug {
sharded<netw::messaging_service>* the_messaging_service;
sharded<cql3::query_processor>* the_query_processor;
sharded<qos::service_level_controller>* the_sl_controller;
sharded<service::migration_manager>* the_migration_manager;
}
int main(int ac, char** av) {
@@ -481,7 +482,7 @@ int main(int ac, char** av) {
service::load_meter load_meter;
debug::db = &db;
auto& proxy = service::get_storage_proxy();
auto& mm = service::get_migration_manager();
sharded<service::migration_manager> mm;
api::http_context ctx(db, proxy, load_meter, token_metadata);
httpd::http_server_control prometheus_server;
std::optional<utils::directories> dirs = {};
@@ -956,6 +957,7 @@ int main(int ac, char** av) {
// #293 - do not stop anything
// engine().at_exit([&proxy] { return proxy.stop(); });
supervisor::notify("starting migration manager");
debug::the_migration_manager = &mm;
mm.start(std::ref(mm_notifier), std::ref(feature_service), std::ref(messaging)).get();
auto stop_migration_manager = defer_verbose_shutdown("migration manager", [&mm] {
mm.stop().get();

View File

@@ -60,8 +60,6 @@ namespace service {
static logging::logger mlogger("migration_manager");
distributed<service::migration_manager> _the_migration_manager;
using namespace std::chrono_literals;
const std::chrono::milliseconds migration_manager::migration_delay = 60000ms;

View File

@@ -190,16 +190,6 @@ public:
future<schema_ptr> get_schema_for_write(table_schema_version, netw::msg_addr from, netw::messaging_service& ms);
};
extern distributed<migration_manager> _the_migration_manager;
inline distributed<migration_manager>& get_migration_manager() {
return _the_migration_manager;
}
inline migration_manager& get_local_migration_manager() {
return _the_migration_manager.local();
}
future<column_mapping> get_column_mapping(utils::UUID table_id, table_schema_version v);
}