]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/progress: Bug fix complete event when OSD marked in 28695/head
authorKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Fri, 21 Jun 2019 18:06:53 +0000 (14:06 -0400)
committerKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Fri, 21 Jun 2019 18:06:53 +0000 (14:06 -0400)
Swap the order of checking for complete event
when OSD is marked in and creating a
PG Recovery event so that the event
doesn't cancel itself.

Signed-off-by: Kamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
src/pybind/mgr/progress/module.py

index dea603702bd2efd93ef4b1daa51ebbe04bd16e22..46ab9e7d03914a303f01e9ce0ef907802803b790 100644 (file)
@@ -360,16 +360,7 @@ class Module(MgrModule):
         self.log.warn("{0} PGs affected by osd.{1} being marked {2}".format(
             len(affected_pgs), osd_id, marked))
 
-        if len(affected_pgs) > 0:
-            ev = PgRecoveryEvent(
-               "Rebalancing after osd.{0} marked {1}".format(osd_id, marked),
-               refs=[("osd", osd_id)],
-               which_pgs=affected_pgs,
-               evacuate_osds=[osd_id]
-            )
-            ev.pg_update(self.get("pg_dump"), self.log)
-            self._events[ev.id] = ev
-            
+           
         # In the case of the osd coming back in, we might need to cancel 
         # previous recovery event for that osd
         if marked == "in":
@@ -380,6 +371,16 @@ class Module(MgrModule):
                     ))
                     self._complete(ev)
 
+        if len(affected_pgs) > 0:
+            ev = PgRecoveryEvent(
+                    "Rebalancing after osd.{0} marked {1}".format(osd_id, marked),
+                    refs=[("osd", osd_id)],
+                    which_pgs=affected_pgs,
+                    evacuate_osds=[osd_id]
+                    )
+            ev.pg_update(self.get("pg_dump"), self.log)
+            self._events[ev.id] = ev
+                 
     def _osdmap_changed(self, old_osdmap, new_osdmap):
         old_dump = old_osdmap.dump()
         new_dump = new_osdmap.dump()