view: get_view_natural_endpoint: get topology from erm
Get the topology for the effective replication map rather than from the storage_proxy to ensure its synchronized with the natural endpoints. Since there's no preemption between the two calls currently there is no issue, so this is merely a clean up of the code and not supposed to fix anything. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -1394,9 +1394,9 @@ static std::optional<gms::inet_address>
|
||||
get_view_natural_endpoint(const sstring& keyspace_name,
|
||||
const dht::token& base_token, const dht::token& view_token) {
|
||||
auto &db = service::get_local_storage_proxy().local_db();
|
||||
auto& topology = service::get_local_storage_proxy().get_token_metadata_ptr()->get_topology();
|
||||
auto& ks = db.find_keyspace(keyspace_name);
|
||||
auto erm = ks.get_effective_replication_map();
|
||||
auto& topology = erm->get_token_metadata_ptr()->get_topology();
|
||||
auto my_address = utils::fb_utilities::get_broadcast_address();
|
||||
auto my_datacenter = topology.get_datacenter();
|
||||
bool network_topology = dynamic_cast<const locator::network_topology_strategy*>(&ks.get_replication_strategy());
|
||||
|
||||
Reference in New Issue
Block a user