]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::choose_acting: let the pg go down if acting is smaller than min_size 2520/head
authorSamuel Just <sam.just@inktank.com>
Wed, 17 Sep 2014 03:36:51 +0000 (20:36 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 17 Sep 2014 03:37:53 +0000 (20:37 -0700)
Even if the backfill peer would bring us up to min_size, we can't go
active since build_prior will not consider the interval maybe_went_rw.

Fixes: #9497
Backport: firefly
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index 2c86f3ba2d2511875be56256b2f2dedbe98f2da2..0f7ffc9800715fa30fc8e57917fd2751004cacf2 100644 (file)
@@ -1268,11 +1268,19 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id)
       ss);
   dout(10) << ss.str() << dendl;
 
-  // This might cause a problem if min_size is large
-  // and we need to backfill more than 1 osd.  Older
-  // code would only include 1 backfill osd and now we
-  // have the resize above.
-  if (want_acting_backfill.size() < pool.info.min_size) {
+  unsigned num_want_acting = 0;
+  for (vector<int>::iterator i = want.begin();
+       i != want.end();
+       ++i) {
+    if (*i != CRUSH_ITEM_NONE)
+      ++num_want_acting;
+  }
+  assert(want_acting_backfill.size() - want_backfill.size() == num_want_acting);
+
+  // This is a bit of a problem, if we allow the pg to go active with
+  // want.size() < min_size, we won't consider the pg to have been
+  // maybe_went_rw in build_prior.
+  if (num_want_acting < pool.info.min_size) {
     want_acting.clear();
     return false;
   }