From c76b3e94b0b6d3e63542ccf28107087657c6bf00 Mon Sep 17 00:00:00 2001 From: AndrewSharapov <93389903+AndrewSharapov@users.noreply.github.com> Date: Fri, 29 Oct 2021 18:10:20 +0300 Subject: [PATCH] mgr/cephadm: Fixed spawning ip addresses list for public network interface. Eevery call of find_ip_on_host() actually duplicates the list of public ip addresses in self.networks, while it should NOT change it. As the result value of key mgr/cephadm/host. in kv store becomes very large and may cause crash of ceph mgr. Signed-off-by: Andrew Sharapov (cherry picked from commit b605b786a2ec95606a2c2791cc643dda3fbe24cc) --- src/pybind/mgr/cephadm/schedule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/cephadm/schedule.py b/src/pybind/mgr/cephadm/schedule.py index 8f4f02e5e4b32..5004ca0fb0219 100644 --- a/src/pybind/mgr/cephadm/schedule.py +++ b/src/pybind/mgr/cephadm/schedule.py @@ -361,8 +361,8 @@ class HostAssignment(object): def find_ip_on_host(self, hostname: str, subnets: List[str]) -> Optional[str]: for subnet in subnets: ips: List[str] = [] - for iface, ips in self.networks.get(hostname, {}).get(subnet, {}).items(): - ips.extend(ips) + for iface, iface_ips in self.networks.get(hostname, {}).get(subnet, {}).items(): + ips.extend(iface_ips) if ips: return sorted(ips)[0] return None -- 2.39.5