mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-09 00:13:31 +00:00
storage_service: Use get_gossip_status to get status
The help is introduced recently, use it. Avoid to open code it.
This commit is contained in:
@@ -499,7 +499,7 @@ public:
|
||||
bool is_silent_shutdown_state(const endpoint_state& ep_state) const;
|
||||
void mark_as_shutdown(const inet_address& endpoint);
|
||||
void force_newer_generation();
|
||||
private:
|
||||
public:
|
||||
sstring get_gossip_status(const endpoint_state& ep_state) const;
|
||||
sstring get_gossip_status(const inet_address& endpoint) const;
|
||||
public:
|
||||
|
||||
@@ -1145,15 +1145,10 @@ future<> storage_service::check_for_endpoint_collision() {
|
||||
if (dht::range_streamer::use_strict_consistency()) {
|
||||
found_bootstrapping_node = false;
|
||||
for (auto& x : gossiper.get_endpoint_states()) {
|
||||
auto status = x.second.get_application_state(application_state::STATUS);
|
||||
if (!status) {
|
||||
auto state = gossiper.get_gossip_status(x.second);
|
||||
if (state.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::vector<sstring> pieces;
|
||||
boost::split(pieces, status.value().value, boost::is_any_of(sstring(versioned_value::DELIMITER_STR)));
|
||||
assert(pieces.size() > 0);
|
||||
auto state = pieces[0];
|
||||
logger.debug("Checking bootstrapping/leaving/moving nodes: node={}, status={} (check_for_endpoint_collision)", x.first, state);
|
||||
if (state == sstring(versioned_value::STATUS_BOOTSTRAPPING) ||
|
||||
state == sstring(versioned_value::STATUS_LEAVING) ||
|
||||
|
||||
Reference in New Issue
Block a user