Only forget offline PGs if their state is not changed during reporting

Vitaliy Filippov 2021-03-08 01:38:48 +03:00
parent 086667f568
commit e91ff2a9ec
1 changed files with 7 additions and 8 deletions

View File

@ -813,11 +813,11 @@ void osd_t::report_pg_states()
for (auto pp: reporting_pgs) for (auto pp: reporting_pgs)
{ {
auto pg_it = this->pgs.find(pp.first); 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
{
// Remove offline PGs after reporting their state
if (pg_it->second.scheme == POOL_SCHEME_JERASURE) if (pg_it->second.scheme == POOL_SCHEME_JERASURE)
{ {
use_jerasure(pg_it->second.pg_size, pg_it->second.pg_data_size, false); use_jerasure(pg_it->second.pg_size, pg_it->second.pg_data_size, false);
@ -825,7 +825,6 @@ void osd_t::report_pg_states()
this->pgs.erase(pg_it); this->pgs.erase(pg_it);
} }
} }
}
// Push other PG state updates, if any // Push other PG state updates, if any
report_pg_states(); report_pg_states();
if (!this->pg_state_dirty.size()) if (!this->pg_state_dirty.size())