-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternator: "/localnodes" request should list public - not internal - IP addresses #18711
Comments
We have a configuration option For |
Looking at https://github.com/scylladb/scylladb/blob/master/docs/kb/yaml-address.rst and https://github.com/scylladb/scylladb/blob/master/docs/operating-scylla/admin.rst I realized now that this area of Scylla is even more complex than I thought. As shown in the above links (and other places including docs/dev/protocols.md), CQL has a whole list of configuration options, most importantly the special option
and we gossip this We can probably use that address instead of gossiping also an Alternator address, but we'll need to document that we did this (and I hope that in @hopugop's use case, they actually set broadcast_rpc_address). |
Don't we have all nodes and their rpc_address stored in some system table that the CQL clients fetch? system.peers perhaps? |
@hopugop I propose the following patch. The only question is whether in your experience (and your setup), we can assume that diff --git a/alternator/server.cc b/alternator/server.cc
--- a/alternator/server.cc
+++ b/alternator/server.cc
std::unordered_set<gms::inet_address> local_dc_nodes = topology.get_datacenter_endpoints().at(local_dc);
for (auto& ip : local_dc_nodes) {
if (_gossiper.is_alive(ip)) {
- rjson::push_back(results, rjson::from_string(ip.to_sstring()));
+ // Use the gossiped broadcast_rpc_address if available instead
+ // of the internal IP address "ip". See discussion in #18711.
+ // Note that currently we don't gossip the alternator_address
+ // configuration, so for now we assume it's not different from
+ // broadcast_rpc_address.
+ rjson::push_back(results, rjson::from_string(_gossiper.get_rpc_address(ip)));
}
}
rep->set_status(reply::status_type::ok); To be a complete patch, I'll also need to add a (see test/alternator/test_scylla.py for an example test of |
Yes, we do, but this is a CQL table so I thought it would be much less efficient than the gossiper's hash table lookup. Although "/localnodes" isn't a very high-performance request (it should be run once every few seconds, not thousands of times per second). By the way, to be honest, I don't know what the Raft-based topology will do or already did to |
@hopugop responded in a different thread that indeed in Scylla Cloud (for example), publicly-accessible clusters have We can still imagine a theoretical situation where there are two different external networks and |
Alternator's non-standard "/localnodes" HTTP request returns a list of live nodes on this DC, to consider for load balancing. The returned node addresses should be external IP addresses usable by the clients. Scylla has a configuration parameter - broadcast_rpc_address - which defines for a node an external IP address. If such a configuration exists, we need to use those external IP addresses, not the internal ones. Finding these broadcast_rpc_address of all nodes is easy, because the gossiper already gossips them. This patch also tests the new feature: 1. The existing single-node test is extended to verify that without broadcast_rpc_address we get the usual IP address. 2. A new two-node test is added to check that when broadcast_rpc_address is configured, we get that address and not the usual internal IP addresses. Fixes scylladb#18711. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
In some Scylla setups, nodes have two network interfaces - an internal network for inter-node communication, and an external network for communicating with clients. Accordingly each node can have two different IP addresses - an internal one and an external one.
@hopugop discovered that Alternator's
/localnodes
request currently returns a list of the internal IP addresses, but this is wrong - it should return a list of external IP addresses.The text was updated successfully, but these errors were encountered: