]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Fixed spawning ip addresses list for public network interface.
authorAndrewSharapov <93389903+AndrewSharapov@users.noreply.github.com>
Fri, 29 Oct 2021 15:10:20 +0000 (18:10 +0300)
committerSebastian Wagner <sewagner@redhat.com>
Wed, 17 Nov 2021 10:25:57 +0000 (11:25 +0100)
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.<hostname> in kv store becomes very large
and may cause crash of ceph mgr.

Signed-off-by: Andrew Sharapov <andrewshar@gmail.com>
(cherry picked from commit b605b786a2ec95606a2c2791cc643dda3fbe24cc)

src/pybind/mgr/cephadm/schedule.py

index 8f4f02e5e4b325ed51c13f3d1f041c07e277a014..5004ca0fb0219230e909b974aa228e5e696074c0 100644 (file)
@@ -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