]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: Look at PG state when PG epoch >= OSDMap epoch
authorKamoltat (Junior) Sirivadhna <ksirivad@redhat.com>
Tue, 4 Jun 2019 15:51:01 +0000 (11:51 -0400)
committerkamoltat <ksirivad@redhat.com>
Sat, 21 Nov 2020 06:45:18 +0000 (06:45 +0000)
In the PgRecoveryEvent class created a
property call self._start_epoch, basically
the epoch of the current OSD. Then use
that propery in pg_update to only allow the
program to look at PG state only when
PG epoch >= start_epoch.

(cherry picked from commit d37e8a4d84d873b7df264c63077805be8618ad7a)

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

index 32bd82c5f313d9616c503ca8e2aa987bc076a29f..9236001ebb8389fa8719709ed16b4f1dc24f632b 100644 (file)
@@ -184,6 +184,8 @@ class PgRecoveryEvent(Event):
 
         self._progress = 0.0
 
+        self._start_epoch = _module.get_osdmap().get_epoch() 
+
         self.id = str(uuid.uuid4())
         self._refresh()
 
@@ -230,7 +232,7 @@ class PgRecoveryEvent(Event):
                 complete.add(pg)
                 continue
             # Only checks the state of each PGs when it's epoch >= the OSDMap's epoch
-            if int(info['reported_epoch']) < int(start_epoch):
+            if int(info['reported_epoch']) < int(self._start_epoch):
                 continue
 
             state = info['state']