From f7e4724770e324c838066d1e3aae02a26e857362 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 10 Jun 2024 12:34:03 +0300 Subject: [PATCH 1/3] main: Register repair API next to repair service Signed-off-by: Pavel Emelyanov --- main.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cc b/main.cc index d9a9f9dd40..ef2d461cb6 100644 --- a/main.cc +++ b/main.cc @@ -1660,6 +1660,10 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl repair.stop().get(); }); repair.invoke_on_all(&repair_service::start).get(); + api::set_server_repair(ctx, repair).get(); + auto stop_repair_api = defer_verbose_shutdown("repair API", [&ctx] { + api::unset_server_repair(ctx).get(); + }); supervisor::notify("starting CDC Generation Management service"); /* This service uses the system distributed keyspace. @@ -1699,10 +1703,6 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl auto stop_messaging_api = defer_verbose_shutdown("messaging service API", [&ctx] { api::unset_server_messaging_service(ctx).get(); }); - api::set_server_repair(ctx, repair).get(); - auto stop_repair_api = defer_verbose_shutdown("repair API", [&ctx] { - api::unset_server_repair(ctx).get(); - }); api::set_server_task_manager(ctx, task_manager, cfg).get(); auto stop_tm_api = defer_verbose_shutdown("task manager API", [&ctx] { From 02c36ebd2e383f010bbfeb9db7902e92bce0c9e7 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 10 Jun 2024 12:34:25 +0300 Subject: [PATCH 2/3] main: Register messaging API next to messaging service Signed-off-by: Pavel Emelyanov --- main.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cc b/main.cc index ef2d461cb6..0c17710bb3 100644 --- a/main.cc +++ b/main.cc @@ -1351,6 +1351,11 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl // before start_listen is called. messaging.invoke_on_all(&netw::messaging_service::start).get(); + api::set_server_messaging_service(ctx, messaging).get(); + auto stop_messaging_api = defer_verbose_shutdown("messaging service API", [&ctx] { + api::unset_server_messaging_service(ctx).get(); + }); + supervisor::notify("starting gossiper"); auto cluster_name = cfg->cluster_name(); if (cluster_name.empty()) { @@ -1699,11 +1704,6 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl supervisor::notify("starting storage service", true); - api::set_server_messaging_service(ctx, messaging).get(); - auto stop_messaging_api = defer_verbose_shutdown("messaging service API", [&ctx] { - api::unset_server_messaging_service(ctx).get(); - }); - api::set_server_task_manager(ctx, task_manager, cfg).get(); auto stop_tm_api = defer_verbose_shutdown("task manager API", [&ctx] { api::unset_server_task_manager(ctx).get(); From b10ddcfd1853799864694e62b239c1ce173c499b Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Mon, 10 Jun 2024 12:35:18 +0300 Subject: [PATCH 3/3] main: Register task manager API next to task manager itself Signed-off-by: Pavel Emelyanov --- main.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main.cc b/main.cc index 0c17710bb3..8ca2b194d9 100644 --- a/main.cc +++ b/main.cc @@ -1013,6 +1013,17 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl task_manager.stop().get(); }); + api::set_server_task_manager(ctx, task_manager, cfg).get(); + auto stop_tm_api = defer_verbose_shutdown("task manager API", [&ctx] { + api::unset_server_task_manager(ctx).get(); + }); +#ifndef SCYLLA_BUILD_MODE_RELEASE + api::set_server_task_manager_test(ctx, task_manager).get(); + auto stop_tm_test_api = defer_verbose_shutdown("task manager API", [&ctx] { + api::unset_server_task_manager_test(ctx).get(); + }); +#endif + // Note: changed from using a move here, because we want the config object intact. replica::database_config dbcfg; dbcfg.compaction_scheduling_group = make_sched_group("compaction", "comp", 1000); @@ -1704,16 +1715,6 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl supervisor::notify("starting storage service", true); - api::set_server_task_manager(ctx, task_manager, cfg).get(); - auto stop_tm_api = defer_verbose_shutdown("task manager API", [&ctx] { - api::unset_server_task_manager(ctx).get(); - }); -#ifndef SCYLLA_BUILD_MODE_RELEASE - api::set_server_task_manager_test(ctx, task_manager).get(); - auto stop_tm_test_api = defer_verbose_shutdown("task manager API", [&ctx] { - api::unset_server_task_manager_test(ctx).get(); - }); -#endif gossiper.local().register_(ss.local().shared_from_this()); auto stop_listening = defer_verbose_shutdown("storage service notifications", [&gossiper, &ss] { gossiper.local().unregister_(ss.local().shared_from_this()).get();