}
pending_conns.reserve(mons.size());
return seastar::parallel_for_each(mons, [this](auto rank) {
- auto peer = monmap.get_addr(rank);
+#warning fixme
+ auto peer = monmap.get_addrs(rank).legacy_addr();
logger().info("connecting to mon.{}", rank);
auto conn = msgr.connect(peer, CEPH_ENTITY_TYPE_MON);
auto& mc = pending_conns.emplace_back(conn, &keyring);
char n[2];
n[0] = 'a' + i;
n[1] = 0;
- string name = prefix;
+ string name;
+ if (!for_mkfs) {
+ name = prefix;
+ }
name += n;
_add_ambiguous_addr(name, addrs[i], 0);
}
// -m foo?
if (const auto mon_host = conf.get_val<std::string>("mon_host");
!mon_host.empty()) {
- if (auto ret = init_with_ips(mon_host, "noname-"); ret == 0) {
+ if (auto ret = init_with_ips(mon_host, for_mkfs, "noname-"); ret == 0) {
return make_ready_future<>();
}
// TODO: resolve_addrs() is a blocking call
- if (auto ret = init_with_hosts(mon_host, "noname-"); ret == 0) {
+ if (auto ret = init_with_hosts(mon_host, for_mkfs, "noname-"); ret == 0) {
return make_ready_future<>();
} else {
throw std::runtime_error(cpp_strerror(ret));
}
// no info found from conf options lets try use DNS SRV records
const string srv_name = conf.get_val<std::string>("mon_dns_srv_name");
- return init_with_dns_srv(srv_name).then([this] {
+ return init_with_dns_srv(for_mkfs, srv_name).then([this] {
if (size() == 0) {
throw std::runtime_error("no monitors specified to connect to.");
}
!mon_host.empty()) {
// NOTE: the for_mkfs path here is dodgey.. it assumes the mons will be
// named 'a', 'b', 'c'.
- auto ret = init_with_ips(mon_host, for_mkfs, for_mkfs ? "" : "noname-");
+ auto ret = init_with_ips(mon_host, for_mkfs, "noname-");
if (ret == -EINVAL) {
- ret = init_with_hosts(mon_host, for_mkfs, for_mkfs ? "" : "noname-");
+ ret = init_with_hosts(mon_host, for_mkfs, "noname-");
}
if (ret < 0) {
errout << "unable to parse addrs in '" << mon_host << "'"