init: get_seeds_from_db_config: accept broadcast_address
Pass the broadcast_address from main to get_seeds_from_db_config rather than getting it from fb_utilities. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
4
init.cc
4
init.cc
@@ -9,7 +9,6 @@
|
||||
#include "init.hh"
|
||||
#include "utils/to_string.hh"
|
||||
#include "gms/inet_address.hh"
|
||||
#include "utils/fb_utilities.hh"
|
||||
#include "seastarx.hh"
|
||||
#include "db/config.hh"
|
||||
|
||||
@@ -18,7 +17,7 @@
|
||||
|
||||
logging::logger startlog("init");
|
||||
|
||||
std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg) {
|
||||
std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg, gms::inet_address broadcast_address) {
|
||||
auto preferred = cfg.listen_interface_prefer_ipv6() ? std::make_optional(net::inet_address::family::INET6) : std::nullopt;
|
||||
auto family = cfg.enable_ipv6_dns_lookup() || preferred ? std::nullopt : std::make_optional(net::inet_address::family::INET);
|
||||
const auto listen = gms::inet_address::lookup(cfg.listen_address(), family).get0();
|
||||
@@ -43,7 +42,6 @@ std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg) {
|
||||
if (seeds.empty()) {
|
||||
seeds.emplace(gms::inet_address("127.0.0.1"));
|
||||
}
|
||||
auto broadcast_address = utils::fb_utilities::get_broadcast_address();
|
||||
startlog.info("seeds={{{}}}, listen_address={}, broadcast_address={}",
|
||||
fmt::join(seeds, ", "), listen, broadcast_address);
|
||||
if (broadcast_address != listen && seeds.contains(listen)) {
|
||||
|
||||
2
init.hh
2
init.hh
@@ -35,7 +35,7 @@ extern logging::logger startlog;
|
||||
|
||||
class bad_configuration_error : public std::exception {};
|
||||
|
||||
std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg);
|
||||
std::set<gms::inet_address> get_seeds_from_db_config(const db::config& cfg, gms::inet_address broadcast_address);
|
||||
|
||||
class service_set {
|
||||
public:
|
||||
|
||||
2
main.cc
2
main.cc
@@ -1287,7 +1287,7 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
|
||||
supervisor::notify("starting gossiper");
|
||||
gms::gossip_config gcfg;
|
||||
gcfg.gossip_scheduling_group = dbcfg.gossip_scheduling_group;
|
||||
gcfg.seeds = get_seeds_from_db_config(*cfg);
|
||||
gcfg.seeds = get_seeds_from_db_config(*cfg, broadcast_addr);
|
||||
gcfg.cluster_name = cfg->cluster_name();
|
||||
gcfg.partitioner = cfg->partitioner();
|
||||
gcfg.ring_delay_ms = cfg->ring_delay_ms();
|
||||
|
||||
Reference in New Issue
Block a user