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,17 +813,16 @@ 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
if (pg_it->second.scheme == POOL_SCHEME_JERASURE)
{ {
// Remove offline PGs after reporting their state use_jerasure(pg_it->second.pg_size, pg_it->second.pg_data_size, false);
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);
} }
this->pgs.erase(pg_it);
} }
} }
// Push other PG state updates, if any // Push other PG state updates, if any