]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/progress: evacuate_osds -> which_osds
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 22 Jul 2019 02:31:55 +0000 (10:31 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 22 Jul 2019 05:17:04 +0000 (13:17 +0800)
PgRecoveryEvent should catch both in and out osds now,
not only out osds. Refresh the corresponding variable
name to better reflecting the function changing.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/pybind/mgr/progress/module.py

index 1c940376ed2829b37a5eea9f4c358e2f3461ebfc..cb026911f41ec6c36f628b5f76547179dd1dbb23 100644 (file)
@@ -149,12 +149,12 @@ class PgRecoveryEvent(Event):
     Always call update() immediately after construction.
     """
 
-    def __init__(self, message, refs, which_pgs, evacuate_osds, start_epoch):
+    def __init__(self, message, refs, which_pgs, which_osds, start_epoch):
         super(PgRecoveryEvent, self).__init__(message, refs)
 
         self._pgs = which_pgs
 
-        self._evacuate_osds = evacuate_osds
+        self._which_osds = which_osds
 
         self._original_pg_count = len(self._pgs)
 
@@ -169,8 +169,8 @@ class PgRecoveryEvent(Event):
         self._refresh()
 
     @property
-    def evacuating_osds(self):
-        return self. _evacuate_osds
+    def which_osds(self):
+        return self. _which_osds
 
     def pg_update(self, pg_dump, log):
         # FIXME: O(pg_num) in python
@@ -392,7 +392,7 @@ class Module(MgrModule):
         # previous recovery event for that osd
         if marked == "in":
             for ev_id, ev in self._events.items():
-                if isinstance(ev, PgRecoveryEvent) and osd_id in ev.evacuating_osds:
+                if isinstance(ev, PgRecoveryEvent) and osd_id in ev.which_osds:
                     self.log.info("osd.{0} came back in, cancelling event".format(
                         osd_id
                     ))
@@ -403,7 +403,7 @@ class Module(MgrModule):
                     "Rebalancing after osd.{0} marked {1}".format(osd_id, marked),
                     refs=[("osd", osd_id)],
                     which_pgs=affected_pgs,
-                    evacuate_osds=[osd_id],
+                    which_osds=[osd_id],
                     start_epoch=self.get_osdmap().get_epoch()
                     )
             ev.pg_update(self.get("pg_dump"), self.log)