From c59c49287adf87c88b78b59a626f2a70269e9c76 Mon Sep 17 00:00:00 2001 From: "Kamoltat (Junior) Sirivadhna" Date: Fri, 14 Jun 2019 10:36:19 -0400 Subject: [PATCH] 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 (cherry picked from commit 901a37f436143a2525d6063f64942019cc888229) Signed-off-by: Kamoltat (Junior) Sirivadhna --- src/pybind/mgr/progress/module.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/progress/module.py b/src/pybind/mgr/progress/module.py index 8fba50d6308e5..3ad514a65a691 100644 --- a/src/pybind/mgr/progress/module.py +++ b/src/pybind/mgr/progress/module.py @@ -370,13 +370,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 )) @@ -384,9 +391,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) @@ -398,8 +402,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: -- 2.39.5