summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2024-11-13 13:25:08 +0100
committerGitHub <noreply@github.com>2024-11-13 13:25:08 +0100
commitce0d6fccc4c3ef1c0d0477e8f6fcd192671a5ee7 (patch)
treebf811c70e950b4cc58caff9de2ba5a32da3759be
parentMerge PR #60464 into main (diff)
parentMake mon addrs consistent with mon info (diff)
downloadceph-ce0d6fccc4c3ef1c0d0477e8f6fcd192671a5ee7.tar.xz
ceph-ce0d6fccc4c3ef1c0d0477e8f6fcd192671a5ee7.zip
Merge pull request #60554 from jshen28/fix-legacy-addr-mismatch
Make mon_info_t consistent with mon_addr Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--src/mon/MonMap.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc
index 5598bbe8709..8d0540d71f2 100644
--- a/src/mon/MonMap.cc
+++ b/src/mon/MonMap.cc
@@ -196,7 +196,12 @@ void MonMap::encode(ceph::buffer::list& blist, uint64_t con_features) const
if (!HAVE_FEATURE(con_features, MONENC) ||
!HAVE_FEATURE(con_features, SERVER_NAUTILUS)) {
for (auto& [name, info] : mon_info) {
- legacy_mon_addr[name] = info.public_addrs.legacy_addr();
+ // see note in mon_info_t::encode()
+ auto addr = info.public_addrs.legacy_addr();
+ if (addr == entity_addr_t()) {
+ addr = info.public_addrs.as_legacy_addr();
+ }
+ legacy_mon_addr[name] = addr;
}
}