mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-24 18:40:38 +00:00
gossip: Simplify get_unreachable_members
_unreachable_endpoints is replicated to call cores. No need to query on core 0. This also fixes a bug in storage_proxy::truncate_blocking which might access _unreachable_endpoints on non-zero cores.
This commit is contained in:
@@ -27,10 +27,9 @@ namespace api {
|
||||
using namespace json;
|
||||
|
||||
void set_gossiper(http_context& ctx, routes& r) {
|
||||
httpd::gossiper_json::get_down_endpoint.set(r, [](std::unique_ptr<request> req) {
|
||||
return gms::get_unreachable_members().then([](std::set<gms::inet_address> res) {
|
||||
return make_ready_future<json::json_return_type>(container_to_vec(res));
|
||||
});
|
||||
httpd::gossiper_json::get_down_endpoint.set(r, [] (const_req req) {
|
||||
auto res = gms::get_local_gossiper().get_unreachable_members();
|
||||
return container_to_vec(res));
|
||||
});
|
||||
|
||||
httpd::gossiper_json::get_live_endpoint.set(r, [] (const_req req) {
|
||||
|
||||
@@ -1464,12 +1464,6 @@ bool gossiper::is_alive(inet_address ep) {
|
||||
}
|
||||
}
|
||||
|
||||
future<std::set<inet_address>> get_unreachable_members() {
|
||||
return smp::submit_to(0, [] {
|
||||
return get_local_gossiper().get_unreachable_members();
|
||||
});
|
||||
}
|
||||
|
||||
future<int64_t> get_endpoint_downtime(inet_address ep) {
|
||||
return smp::submit_to(0, [ep] {
|
||||
return get_local_gossiper().get_endpoint_downtime(ep);
|
||||
|
||||
@@ -460,7 +460,6 @@ inline distributed<gossiper>& get_gossiper() {
|
||||
return _the_gossiper;
|
||||
}
|
||||
|
||||
future<std::set<inet_address>> get_unreachable_members();
|
||||
future<int64_t> get_endpoint_downtime(inet_address ep);
|
||||
future<int> get_current_generation_number(inet_address ep);
|
||||
future<int> get_current_heart_beat_version(inet_address ep);
|
||||
|
||||
Reference in New Issue
Block a user