mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
storage_service: Merge init-server and join-cluster
Now they always follow one another both in main and cql-test-env. Also, despite the name, init-server does joins the cluster when it's just a normal node restarting, so join-cluster is called when the cluster is already joind. This merge make the function be named as what it really does. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
6
main.cc
6
main.cc
@@ -1273,11 +1273,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
|
||||
}).get();
|
||||
|
||||
with_scheduling_group(maintenance_scheduling_group, [&] {
|
||||
return ss.local().init_server(qp.local(), group0_client);
|
||||
}).get();
|
||||
|
||||
with_scheduling_group(maintenance_scheduling_group, [&] {
|
||||
return ss.local().join_cluster();
|
||||
return ss.local().join_cluster(qp.local(), group0_client);
|
||||
}).get();
|
||||
|
||||
sl_controller.invoke_on_all([&lifecycle_notifier] (qos::service_level_controller& controller) {
|
||||
|
||||
@@ -1322,7 +1322,7 @@ future<> storage_service::uninit_messaging_service_part() {
|
||||
return container().invoke_on_all(&service::storage_service::uninit_messaging_service);
|
||||
}
|
||||
|
||||
future<> storage_service::init_server(cql3::query_processor& qp, raft_group0_client& client) {
|
||||
future<> storage_service::join_cluster(cql3::query_processor& qp, raft_group0_client& client) {
|
||||
assert(this_shard_id() == 0);
|
||||
|
||||
return seastar::async([this, &qp, &client] {
|
||||
@@ -1380,11 +1380,6 @@ future<> storage_service::init_server(cql3::query_processor& qp, raft_group0_cli
|
||||
slogger.info("peer={}, supported_features={}", x.first, x.second);
|
||||
}
|
||||
prepare_to_join(std::move(initial_contact_nodes), std::move(loaded_endpoints), std::move(loaded_peer_features)).get();
|
||||
});
|
||||
}
|
||||
|
||||
future<> storage_service::join_cluster() {
|
||||
return seastar::async([this] {
|
||||
join_token_ring(get_ring_delay());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -362,9 +362,6 @@ public:
|
||||
*
|
||||
* The storage_service initialization is done in two parts.
|
||||
*
|
||||
* you first call init_messaging_service_part and then
|
||||
* you call init_server_without_the_messaging_service_part.
|
||||
*
|
||||
* It is safe to start the API after init_messaging_service_part
|
||||
* completed
|
||||
*
|
||||
@@ -372,9 +369,7 @@ public:
|
||||
*
|
||||
* \see init_messaging_service_part
|
||||
*/
|
||||
future<> init_server(cql3::query_processor& qp, raft_group0_client& client);
|
||||
|
||||
future<> join_cluster();
|
||||
future<> join_cluster(cql3::query_processor& qp, raft_group0_client& client);
|
||||
|
||||
future<> drain_on_shutdown();
|
||||
|
||||
|
||||
@@ -782,9 +782,8 @@ public:
|
||||
cdc.stop().get();
|
||||
});
|
||||
|
||||
ss.local().init_server(qp.local(), group0_client).get();
|
||||
try {
|
||||
ss.local().join_cluster().get();
|
||||
ss.local().join_cluster(qp.local(), group0_client).get();
|
||||
} catch (std::exception& e) {
|
||||
// if any of the defers crashes too, we'll never see
|
||||
// the error
|
||||
|
||||
Reference in New Issue
Block a user