From 6f1db4fb7213f2ffc71fdfe71eeec41f6cc8ca10 Mon Sep 17 00:00:00 2001 From: Asias He Date: Tue, 27 Oct 2015 09:25:27 +0800 Subject: [PATCH] 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. --- api/gossiper.cc | 7 +++---- gms/gossiper.cc | 6 ------ gms/gossiper.hh | 1 - 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/api/gossiper.cc b/api/gossiper.cc index 65115144e1..6dbd1f69f3 100644 --- a/api/gossiper.cc +++ b/api/gossiper.cc @@ -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 req) { - return gms::get_unreachable_members().then([](std::set res) { - return make_ready_future(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) { diff --git a/gms/gossiper.cc b/gms/gossiper.cc index 95c23a7fd2..b79e419361 100644 --- a/gms/gossiper.cc +++ b/gms/gossiper.cc @@ -1464,12 +1464,6 @@ bool gossiper::is_alive(inet_address ep) { } } -future> get_unreachable_members() { - return smp::submit_to(0, [] { - return get_local_gossiper().get_unreachable_members(); - }); -} - future get_endpoint_downtime(inet_address ep) { return smp::submit_to(0, [ep] { return get_local_gossiper().get_endpoint_downtime(ep); diff --git a/gms/gossiper.hh b/gms/gossiper.hh index 45d5868d55..a254af2c8b 100644 --- a/gms/gossiper.hh +++ b/gms/gossiper.hh @@ -460,7 +460,6 @@ inline distributed& get_gossiper() { return _the_gossiper; } -future> get_unreachable_members(); future get_endpoint_downtime(inet_address ep); future get_current_generation_number(inet_address ep); future get_current_heart_beat_version(inet_address ep);