From ab21a1908b00a7d01a07ebd6aa945667592aa6ad Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 6 Mar 2021 02:53:19 +0300 Subject: [PATCH] Check for the dirty PG flag when trying to continue to stop it after sync --- src/osd_primary.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd_primary.cpp b/src/osd_primary.cpp index 21388196..90965548 100644 --- a/src/osd_primary.cpp +++ b/src/osd_primary.cpp @@ -656,7 +656,9 @@ resume_6: { auto & pg = pgs.at(op_data->dirty_pgs[i]); pg.inflight--; - if ((pg.state & PG_STOPPING) && pg.inflight == 0 && !pg.flush_batch) + if ((pg.state & PG_STOPPING) && 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); }