]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: maybe clear DEGRADED on recovery completion
authorSage Weil <sage.weil@dreamhost.com>
Thu, 15 Mar 2012 17:35:40 +0000 (10:35 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 15 Mar 2012 17:35:40 +0000 (10:35 -0700)
We set degraded if we don't have enough "active" replicas, which excludes
the backfill target.  We need to recheck that when we finish recovery and
the backfill target is now complete.

Fixes: #2160
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
src/osd/PG.cc

index b32ab11d0407614b71b6e680e8e4a6c6887117d6..1516fe20555942bc1a4271061aea38f8a0ad23fb 100644 (file)
@@ -4136,6 +4136,11 @@ boost::statechart::result PG::RecoveryState::Active::react(const RecoveryComplet
   pg->state_clear(PG_STATE_BACKFILL);
   pg->state_clear(PG_STATE_RECOVERING);
 
+  // if we finished backfill, all acting are active; recheck if
+  // DEGRADED is appropriate.
+  if (pg->get_osdmap()->get_pg_size(pg->info.pgid) <= pg->acting.size())
+    pg->state_clear(PG_STATE_DEGRADED);
+
   // adjust acting set?  (e.g. because backfill completed...)
   if (pg->acting != pg->up &&
       !pg->choose_acting(newest_update_osd)) {