From: AndrewSharapov <93389903+AndrewSharapov@users.noreply.github.com> Date: Fri, 29 Oct 2021 15:10:20 +0000 (+0300) Subject: mgr/cephadm: Fixed spawning ip addresses list for public network interface. X-Git-Tag: v17.1.0~516^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b605b786a2ec95606a2c2791cc643dda3fbe24cc;p=ceph.git 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 --- diff --git a/src/pybind/mgr/cephadm/schedule.py b/src/pybind/mgr/cephadm/schedule.py index 8f4f02e5e4b3..5004ca0fb021 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