From: Kamoltat (Junior) Sirivadhna Date: Fri, 14 Jun 2019 14:36:19 +0000 (-0400) Subject: mgr/progress: Add recovery event when OSD marked in X-Git-Tag: v15.1.0~2416^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=901a37f436143a2525d6063f64942019cc888229;p=ceph.git mgr/progress: Add recovery event when OSD marked in Added the check for osd_id to account for the acting set of both the old and new maps to cover both osd marked out and in respectively Signed-off-by: Kamoltat (Junior) Sirivadhna --- diff --git a/src/pybind/mgr/progress/module.py b/src/pybind/mgr/progress/module.py index 8c356132b154..dea603702bd2 100644 --- a/src/pybind/mgr/progress/module.py +++ b/src/pybind/mgr/progress/module.py @@ -311,13 +311,20 @@ class Module(MgrModule): for ps in range(0, pool['pg_num']): # Was this OSD affected by the OSD coming in/out? + # Compare old and new osds using + # data from the json dump old_up_acting = old_map.pg_to_up_acting_osds(pool['pool'], ps) old_osds = set(old_up_acting['acting']) - was_on_out_osd = osd_id in old_osds - if not was_on_out_osd: + new_up_acting = new_map.pg_to_up_acting_osds(pool['pool'], ps) + new_osds = set(new_up_acting['acting']) + + # Check the osd_id being in the acting set for both old + # and new maps to cover both out and in cases + was_on_out_or_in_osd = osd_id in old_osds or osd_id in new_osds + if not was_on_out_or_in_osd: continue - + self.log.debug("pool_id, ps = {0}, {1}".format( pool_id, ps )) @@ -325,9 +332,6 @@ class Module(MgrModule): self.log.debug( "old_up_acting: {0}".format(json.dumps(old_up_acting, indent=2))) - new_up_acting = new_map.pg_to_up_acting_osds(pool['pool'], ps) - new_osds = set(new_up_acting['acting']) - # Has this OSD been assigned a new location? # (it might not be if there is no suitable place to move # after an OSD is marked in/out) @@ -339,8 +343,8 @@ class Module(MgrModule): self.log.debug( "new_up_acting: {0}".format(json.dumps(new_up_acting, indent=2))) - - if was_on_out_osd and is_relocated: + + if was_on_out_or_in_osd and is_relocated: # This PG is now in motion, track its progress affected_pgs.append(PgId(pool_id, ps)) elif not is_relocated: