From: xie xingguo Date: Mon, 22 Jul 2019 02:31:55 +0000 (+0800) Subject: mgr/progress: evacuate_osds -> which_osds X-Git-Tag: v15.1.0~2049^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ba264e8acfc1a7788ca17ebec2d480ca2979455;p=ceph-ci.git mgr/progress: evacuate_osds -> which_osds 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 --- diff --git a/src/pybind/mgr/progress/module.py b/src/pybind/mgr/progress/module.py index 1c940376ed2..cb026911f41 100644 --- a/src/pybind/mgr/progress/module.py +++ b/src/pybind/mgr/progress/module.py @@ -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)