]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: cached osd_map pop pg_temp 64805/head
authorNitzan Mordechai <nmordech@ibm.com>
Thu, 4 Jun 2026 06:52:18 +0000 (06:52 +0000)
committerNitzan Mordechai <nmordech@ibm.com>
Thu, 4 Jun 2026 06:52:35 +0000 (06:52 +0000)
get('osd_map') returns the cached object directly, so del and key
assignments were silently corrupting the cache for subsequent callers.
Take a shallow copy before modifying, and use pop() instead of del in
case the cache was already corrupted.

Fixes: https://tracker.ceph.com/issues/72447
Signed-off-by: Nitzan Mordechai <nmordec@ibm.com>
src/pybind/mgr/dashboard/controllers/health.py

index b9509511123ec4cd4c2eb353585163a950e71351..d0d4e24e05f83341173bdeac4b91e8f43ede923c 100644 (file)
@@ -296,10 +296,10 @@ class HealthData(object):
         return mon_status
 
     def osd_map(self):
-        osd_map = mgr.get('osd_map')
+        osd_map = dict(mgr.get('osd_map'))
         assert osd_map is not None
         # Not needed, skip the effort of transmitting this to UI
-        del osd_map['pg_temp']
+        osd_map.pop('pg_temp', None)
         if self._minimal:
             osd_map = partial_dict(osd_map, ['osds'])
             osd_map['osds'] = [