From e91ff2a9ec78a0d18a94d796efac23ccb6bd2a10 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 8 Mar 2021 01:38:48 +0300 Subject: [PATCH] Only forget offline PGs if their state is not changed during reporting --- src/osd_cluster.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/osd_cluster.cpp b/src/osd_cluster.cpp index 860634b1..8d06d011 100644 --- a/src/osd_cluster.cpp +++ b/src/osd_cluster.cpp @@ -813,17 +813,16 @@ void osd_t::report_pg_states() for (auto pp: reporting_pgs) { auto pg_it = this->pgs.find(pp.first); - if (pg_it != this->pgs.end()) + if (pg_it != this->pgs.end() && + pg_it->second.state == PG_OFFLINE && + pg_state_dirty.find(pp.first) == pg_state_dirty.end()) { - if (pg_it->second.state == PG_OFFLINE) + // Forget offline PGs after reporting their state + if (pg_it->second.scheme == POOL_SCHEME_JERASURE) { - // Remove offline PGs after reporting their state - if (pg_it->second.scheme == POOL_SCHEME_JERASURE) - { - use_jerasure(pg_it->second.pg_size, pg_it->second.pg_data_size, false); - } - this->pgs.erase(pg_it); + use_jerasure(pg_it->second.pg_size, pg_it->second.pg_data_size, false); } + this->pgs.erase(pg_it); } } // Push other PG state updates, if any