treewide: drop endpoint life cycle subscribers that do nothing

Provide default implementation for them instead. Will be easier to rework them later.
This commit is contained in:
Gleb Natapov
2025-02-12 10:35:21 +02:00
parent 525b88f877
commit 8a747fbc2a
6 changed files with 4 additions and 21 deletions

View File

@@ -35,7 +35,7 @@ public:
*
* @param endpoint the newly added endpoint.
*/
virtual void on_join_cluster(const gms::inet_address& endpoint) = 0;
virtual void on_join_cluster(const gms::inet_address& endpoint) {}
/**
* Called when a new node leave the cluster (decommission or removeToken).
@@ -43,21 +43,21 @@ public:
* @param endpoint the IP of the endpoint that is leaving.
* @param host_id the host ID of the endpoint that is leaving.
*/
virtual void on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& host_id) = 0;
virtual void on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& host_id) {}
/**
* Called when a node is marked UP.
*
* @param endpoint the endpoint marked UP.
*/
virtual void on_up(const gms::inet_address& endpoint) = 0;
virtual void on_up(const gms::inet_address& endpoint) {}
/**
* Called when a node is marked DOWN.
*
* @param endpoint the endpoint marked DOWN.
*/
virtual void on_down(const gms::inet_address& endpoint) = 0;
virtual void on_down(const gms::inet_address& endpoint) {}
};
class endpoint_lifecycle_notifier {

View File

@@ -891,8 +891,6 @@ future<> service_level_controller::do_remove_service_level(sstring name, bool re
return make_ready_future();
}
void service_level_controller::on_join_cluster(const gms::inet_address& endpoint) { }
void service_level_controller::on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& hid) {
if (this_shard_id() == global_controller && _token_metadata.get()->get_topology().is_me(hid)) {
_global_controller_db->dist_data_update_aborter.request_abort();
@@ -900,10 +898,6 @@ void service_level_controller::on_leave_cluster(const gms::inet_address& endpoin
}
}
void service_level_controller::on_up(const gms::inet_address& endpoint) { }
void service_level_controller::on_down(const gms::inet_address& endpoint) { }
void service_level_controller::register_subscriber(qos_configuration_change_subscriber* subscriber) {
_subscribers.add(subscriber);
}

View File

@@ -439,10 +439,7 @@ public:
static sstring default_service_level_name;
virtual void on_join_cluster(const gms::inet_address& endpoint) override;
virtual void on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& hid) override;
virtual void on_up(const gms::inet_address& endpoint) override;
virtual void on_down(const gms::inet_address& endpoint) override;
};
future<shared_ptr<service_level_controller::service_level_distributed_data_accessor>>

View File

@@ -6899,16 +6899,12 @@ future<> storage_proxy::wait_for_hint_sync_point(const db::hints::sync_point spo
co_return;
}
void storage_proxy::on_join_cluster(const gms::inet_address& endpoint) {};
void storage_proxy::on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& hid) {
// Discarding these futures is safe. They're awaited by db::hints::manager::stop().
(void) _hints_manager.drain_for(hid, endpoint);
(void) _hints_for_views_manager.drain_for(hid, endpoint);
}
void storage_proxy::on_up(const gms::inet_address& endpoint) {};
void storage_proxy::cancel_write_handlers(noncopyable_function<bool(const abstract_write_response_handler&)> filter_fun) {
SCYLLA_ASSERT(thread::running_in_thread());
auto it = _cancellable_write_handlers_list->begin();

View File

@@ -741,9 +741,7 @@ public:
return _pending_writes_phaser.advance_and_await();
}
virtual void on_join_cluster(const gms::inet_address& endpoint) override;
virtual void on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& hid) override;
virtual void on_up(const gms::inet_address& endpoint) override;
virtual void on_down(const gms::inet_address& endpoint) override;
friend class abstract_read_executor;

View File

@@ -2859,8 +2859,6 @@ public:
future<> run();
future<> stop();
virtual void on_join_cluster(const gms::inet_address& endpoint) {}
virtual void on_leave_cluster(const gms::inet_address& endpoint, const locator::host_id& hid) {};
virtual void on_up(const gms::inet_address& endpoint) { _topo_sm.event.broadcast(); };
virtual void on_down(const gms::inet_address& endpoint) { _topo_sm.event.broadcast(); };
};