From: Samuel Just Date: Thu, 23 Feb 2017 00:22:46 +0000 (-0800) Subject: PG: set CLEAN if we have enough replicas X-Git-Tag: v12.1.2~1^2~44^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d24a8886658c2d8882275d69c6409717a62701be;p=ceph.git PG: set CLEAN if we have enough replicas Previously, we'd only set CLEAN if we were not also remapped, but we'd set last_epoch_clean anyway. Unfortunately, that wasn't consistent with pg_stat_t::get_effective_last_epoch_clean() which requires that the CLEAN bit be set to continue trimming while the pg state isn't changing. Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 1c9787a69b96..6b94abbb5c6b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2003,21 +2003,14 @@ struct C_PG_FinishRecovery : public Context { void PG::mark_clean() { - // only mark CLEAN if we have the desired number of replicas AND we - // are not remapped. - if (actingset.size() == get_osdmap()->get_pg_size(info.pgid.pgid) && - up == acting) + if (actingset.size() == get_osdmap()->get_pg_size(info.pgid.pgid)) { state_set(PG_STATE_CLEAN); - - // NOTE: this is actually a bit premature: we haven't purged the - // strays yet. - info.history.last_epoch_clean = get_osdmap()->get_epoch(); - info.history.last_interval_clean = info.history.same_interval_since; - - past_intervals.clear(); - dirty_big_info = true; - - dirty_info = true; + info.history.last_epoch_clean = get_osdmap()->get_epoch(); + info.history.last_interval_clean = info.history.same_interval_since; + past_intervals.clear(); + dirty_big_info = true; + dirty_info = true; + } kick_snap_trim(); }