Wait for PGs to become clean before stopping them

This commit is contained in:
Vitaliy Filippov
2021-02-28 19:36:59 +03:00
parent 41fd14e024
commit 46e79f3306
+3 -1
View File
@@ -473,7 +473,9 @@ bool osd_t::stop_pg(pg_t & pg)
return false;
}
pg.state = pg.state & ~PG_ACTIVE | PG_STOPPING;
if (pg.inflight == 0 && !pg.flush_batch)
if (pg.inflight == 0 && !pg.flush_batch &&
// We must either forget all PG's unstable writes or wait for it to become clean
dirty_pgs.find({ .pool_id = pg.pool_id, .pg_num = pg.pg_num }) == dirty_pgs.end())
{
finish_stop_pg(pg);
}