diff --git a/api/api.cc b/api/api.cc index dfbe9eee32..e92cd14591 100644 --- a/api/api.cc +++ b/api/api.cc @@ -73,6 +73,8 @@ future<> set_server_init(http_context& ctx) { set_error_injection(ctx, r); rb->register_function(r, "storage_proxy", "The storage proxy API"); + rb->register_function(r, "storage_service", + "The storage service API"); }); } @@ -115,7 +117,7 @@ future<> unset_thrift_controller(http_context& ctx) { } future<> set_server_storage_service(http_context& ctx, sharded& ss, service::raft_group0_client& group0_client) { - return register_api(ctx, "storage_service", "The storage service API", [&ss, &group0_client] (http_context& ctx, routes& r) { + return ctx.http_server.set_routes([&ctx, &ss, &group0_client] (routes& r) { set_storage_service(ctx, r, ss, group0_client); }); } diff --git a/main.cc b/main.cc index 69bc484cea..f65519a09d 100644 --- a/main.cc +++ b/main.cc @@ -985,6 +985,12 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl // token_metadata.stop().get(); //}); + api::set_server_token_metadata(ctx, token_metadata).get(); + auto stop_tokens_api = defer_verbose_shutdown("token metadata API", [&ctx] { + api::unset_server_token_metadata(ctx).get(); + }); + + supervisor::notify("starting effective_replication_map factory"); erm_factory.start().get(); auto stop_erm_factory = deferred_stop(erm_factory); @@ -1492,13 +1498,6 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl tablet_allocator.stop().get(); }); - // FIXME -- this can happen next to token_metadata start, but it needs "storage_service" - // API register, so it comes that late for now - api::set_server_token_metadata(ctx, token_metadata).get(); - auto stop_tokens_api = defer_verbose_shutdown("token metadata API", [&ctx] { - api::unset_server_token_metadata(ctx).get(); - }); - supervisor::notify("starting mapreduce service"); mapreduce_service.start(std::ref(messaging), std::ref(proxy), std::ref(db), std::ref(token_metadata), std::ref(stop_signal.as_sharded_abort_source())).get(); auto stop_mapreduce_service_handlers = defer_verbose_shutdown("mapreduce service", [&mapreduce_service] {