From 09b3e4e7899b1723b0bdfe7aed6b2e0764f0171f Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 6 Mar 2021 01:57:52 +0300 Subject: [PATCH] Fix OSDs being unable to stop PGs that are 'peering', not 'active' This was sometimes leading to incorrect misplaced and degraded object count statistics --- src/osd_peering.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osd_peering.cpp b/src/osd_peering.cpp index 092af810..8928a398 100644 --- a/src/osd_peering.cpp +++ b/src/osd_peering.cpp @@ -468,10 +468,15 @@ bool osd_t::stop_pg(pg_t & pg) delete pg.peering_state; pg.peering_state = NULL; } - if (!(pg.state & PG_ACTIVE)) + if (pg.state & PG_STOPPING) { return false; } + if (!(pg.state & PG_ACTIVE)) + { + finish_stop_pg(pg); + return true; + } pg.state = pg.state & ~PG_ACTIVE | PG_STOPPING; if (pg.inflight == 0 && !pg.flush_batch && // We must either forget all PG's unstable writes or wait for it to become clean