diff --git a/locator/abstract_replication_strategy.cc b/locator/abstract_replication_strategy.cc index f72e63722a..5f1b7d1a15 100644 --- a/locator/abstract_replication_strategy.cc +++ b/locator/abstract_replication_strategy.cc @@ -103,6 +103,10 @@ inet_address_vector_replica_set effective_replication_map::get_natural_endpoints return natural_endpoints; } +inet_address_vector_topology_change effective_replication_map::get_pending_endpoints(const token& search_token, const sstring& ks_name) const { + return _tmptr->pending_endpoints_for(search_token, ks_name); +} + void abstract_replication_strategy::validate_replication_factor(sstring rf) { if (rf.empty() || std::any_of(rf.begin(), rf.end(), [] (char c) {return !isdigit(c);})) { diff --git a/locator/abstract_replication_strategy.hh b/locator/abstract_replication_strategy.hh index d30310e8f7..d99cacac33 100644 --- a/locator/abstract_replication_strategy.hh +++ b/locator/abstract_replication_strategy.hh @@ -205,6 +205,7 @@ public: inet_address_vector_replica_set get_natural_endpoints(const token& search_token) const; stop_iteration for_each_natural_endpoint_until(const token& search_token, const noncopyable_function& func) const; inet_address_vector_replica_set get_natural_endpoints_without_node_being_replaced(const token& search_token) const; + inet_address_vector_topology_change get_pending_endpoints(const token& search_token, const sstring& ks_name) const; // get_ranges() returns the list of ranges held by the given endpoint. // The list is sorted, and its elements are non overlapping and non wrap-around. diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index f2929549d9..63f1e7c0b6 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -2846,7 +2846,7 @@ storage_proxy::create_write_response_handler_helper(schema_ptr s, const dht::tok replica::keyspace& ks = _db.local().find_keyspace(keyspace_name); auto erm = ks.get_effective_replication_map(); inet_address_vector_replica_set natural_endpoints = erm->get_natural_endpoints_without_node_being_replaced(token); - inet_address_vector_topology_change pending_endpoints = erm->get_token_metadata_ptr()->pending_endpoints_for(token, keyspace_name); + inet_address_vector_topology_change pending_endpoints = erm->get_pending_endpoints(token, keyspace_name); slogger.trace("creating write handler for token: {} natural: {} pending: {}", token, natural_endpoints, pending_endpoints); tracing::trace(tr_state, "Creating write handler for token: {} natural: {} pending: {}", token, natural_endpoints ,pending_endpoints); @@ -3209,7 +3209,7 @@ future<> storage_proxy::mutate_counters(Range&& mutations, db::consistency_level storage_proxy::paxos_participants storage_proxy::get_paxos_participants(const sstring& ks_name, const locator::effective_replication_map& erm, const dht::token &token, db::consistency_level cl_for_paxos) { inet_address_vector_replica_set natural_endpoints = erm.get_natural_endpoints_without_node_being_replaced(token); - inet_address_vector_topology_change pending_endpoints = erm.get_token_metadata_ptr()->pending_endpoints_for(token, ks_name); + inet_address_vector_topology_change pending_endpoints = erm.get_pending_endpoints(token, ks_name); if (cl_for_paxos == db::consistency_level::LOCAL_SERIAL) { auto local_dc_filter = erm.get_topology().get_local_dc_filter();