mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-02 04:56:58 +00:00
storage_service: return unordered_set from get_ignore_dead_nodes_for_replace
This commit is contained in:
@@ -1332,9 +1332,9 @@ future<> storage_service::mark_existing_views_as_built(sharded<db::system_distri
|
||||
});
|
||||
}
|
||||
|
||||
std::list<gms::inet_address> storage_service::get_ignore_dead_nodes_for_replace(const token_metadata& tm) {
|
||||
std::unordered_set<gms::inet_address> storage_service::get_ignore_dead_nodes_for_replace(const token_metadata& tm) {
|
||||
std::vector<sstring> ignore_nodes_strs;
|
||||
std::list<gms::inet_address> ignore_nodes;
|
||||
std::unordered_set<gms::inet_address> ignore_nodes;
|
||||
boost::split(ignore_nodes_strs, _db.local().get_config().ignore_dead_nodes_for_replace(), boost::is_any_of(","));
|
||||
for (std::string n : ignore_nodes_strs) {
|
||||
try {
|
||||
@@ -1343,7 +1343,7 @@ std::list<gms::inet_address> storage_service::get_ignore_dead_nodes_for_replace(
|
||||
boost::trim_all(n);
|
||||
if (!n.empty()) {
|
||||
auto ep_and_id = tm.parse_host_id_and_endpoint(n);
|
||||
ignore_nodes.push_back(ep_and_id.endpoint);
|
||||
ignore_nodes.insert(ep_and_id.endpoint);
|
||||
}
|
||||
} catch (...) {
|
||||
throw std::runtime_error(format("Failed to parse --ignore-dead-nodes-for-replace parameter: ignore_nodes={}, node={}: {}", ignore_nodes_strs, n, std::current_exception()));
|
||||
@@ -3103,7 +3103,7 @@ void storage_service::run_replace_ops(std::unordered_set<token>& bootstrap_token
|
||||
const auto& uuid = ctl.uuid();
|
||||
gms::inet_address replace_address = replace_info.address;
|
||||
auto tmptr = get_token_metadata_ptr();
|
||||
ctl.ignore_nodes = boost::copy_range<std::unordered_set<inet_address>>(get_ignore_dead_nodes_for_replace(*tmptr));
|
||||
ctl.ignore_nodes = get_ignore_dead_nodes_for_replace(*tmptr);
|
||||
// Step 1: Decide who needs to sync data for replace operation
|
||||
for (const auto& [node, eps] :_gossiper.get_endpoint_states()) {
|
||||
seastar::thread::maybe_yield();
|
||||
|
||||
@@ -294,7 +294,7 @@ private:
|
||||
void run_replace_ops(std::unordered_set<token>& bootstrap_tokens, replacement_info replace_info);
|
||||
void run_bootstrap_ops(std::unordered_set<token>& bootstrap_tokens);
|
||||
|
||||
std::list<gms::inet_address> get_ignore_dead_nodes_for_replace(const locator::token_metadata& tm);
|
||||
std::unordered_set<gms::inet_address> get_ignore_dead_nodes_for_replace(const locator::token_metadata& tm);
|
||||
future<> wait_for_ring_to_settle(std::chrono::milliseconds delay);
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user