From 9b453153f209f1b4e6d8edb8ae385f4c25fbc17d Mon Sep 17 00:00:00 2001 From: "Kamoltat (Junior) Sirivadhna" Date: Tue, 4 Jun 2019 11:51:01 -0400 Subject: [PATCH] mgr: Look at PG state when PG epoch >= OSDMap epoch 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 --- src/pybind/mgr/progress/module.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/progress/module.py b/src/pybind/mgr/progress/module.py index 32bd82c5f31..9236001ebb8 100644 --- a/src/pybind/mgr/progress/module.py +++ b/src/pybind/mgr/progress/module.py @@ -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'] -- 2.47.3