mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 20:46:56 +00:00
Merge 'Topology: use this host_id in is_configured_this_node' from Benny Halevy
Since 5d1f60439a we have
this node's host_id in topology config, so it can be used
to determine this node when adding it.
Prepare for extending the token_metadata interface
to provide host_id in update_topology.
We would like to compare the host_id first to be able to distinguish
this node from a node we're replacing that may have the same ip address
(but different host_id).
Closes #15297
* github.com:scylladb/scylladb:
locator: topology: is_configured_this_node: delete spurious semicolumn
locator: topology: is_configured_this_node: compare host_id first
This commit is contained in:
@@ -141,8 +141,11 @@ const node* topology::add_node(host_id id, const inet_address& ep, const endpoin
|
||||
}
|
||||
|
||||
bool topology::is_configured_this_node(const node& n) const {
|
||||
if (_cfg.this_host_id && n.host_id()) { // Selection by host_id
|
||||
return _cfg.this_host_id == n.host_id();
|
||||
}
|
||||
if (_cfg.this_endpoint != inet_address()) { // Selection by endpoint
|
||||
return _cfg.this_endpoint == n.endpoint();;
|
||||
return _cfg.this_endpoint == n.endpoint();
|
||||
}
|
||||
return false; // No selection;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user