]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: (re)set degraded flag on activate
authorSage Weil <sage@newdream.net>
Wed, 26 Nov 2008 18:55:54 +0000 (10:55 -0800)
committerSage Weil <sage@newdream.net>
Wed, 26 Nov 2008 18:55:54 +0000 (10:55 -0800)
This ensures the bit is properly set on newly created PGs..

src/osd/PG.cc

index 8dfbe2cc18132815a4a1db148209cf9aecc29ced..0c9334ccbb32f3e712324cac1eca61fde5b8ec3d 100644 (file)
@@ -1134,7 +1134,12 @@ void PG::activate(ObjectStore::Transaction& t,
     state_clear(PG_STATE_CRASHED);
     state_clear(PG_STATE_REPLAY);
   }
-
+  if (is_primary() && 
+      info.pgid.size() != acting.size())
+    state_set(PG_STATE_DEGRADED);
+  else
+    state_clear(PG_STATE_DEGRADED);
+  
   info.history.last_epoch_started = osd->osdmap->get_epoch();
   trim_past_intervals();