]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: set CLEAN if we have enough replicas 15555/head
authorSamuel Just <sjust@redhat.com>
Thu, 23 Feb 2017 00:22:46 +0000 (16:22 -0800)
committerSage Weil <sage@redhat.com>
Wed, 7 Jun 2017 15:29:08 +0000 (11:29 -0400)
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 <sjust@redhat.com>
src/osd/PG.cc

index 1c9787a69b96e1c76b3161bfd6d44fe24cbb478a..6b94abbb5c6b0c99eb5d514076ec2640826e73b9 100644 (file)
@@ -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();
 }