]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: consider CRUSH_ITEM_NONE in check_new_interval() min_size check 2708/head
authorSage Weil <sage@redhat.com>
Sun, 12 Oct 2014 17:05:51 +0000 (10:05 -0700)
committerSage Weil <sage@redhat.com>
Sun, 12 Oct 2014 17:05:51 +0000 (10:05 -0700)
Fixes: #9718
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/osd_types.cc

index d7081b97ede0b6a3349a062fb0dcb559690529c1..47cb37bc084724afbf64fb12f07b3d2d865cf6b4 100644 (file)
@@ -2384,9 +2384,15 @@ bool pg_interval_t::check_new_interval(
     i.primary = old_acting_primary;
     i.up_primary = old_up_primary;
 
-    if (!i.acting.empty() && i.primary != -1 &&
-       i.acting.size() >=
-       lastmap->get_pools().find(pgid.pool())->second.min_size) {
+    unsigned num_acting = 0;
+    for (vector<int>::const_iterator p = i.acting.begin(); p != i.acting.end();
+        ++p)
+      if (*p != CRUSH_ITEM_NONE)
+       ++num_acting;
+
+    if (num_acting &&
+       i.primary != -1 &&
+       num_acting >= lastmap->get_pools().find(pgid.pool())->second.min_size) {
       if (out)
        *out << "generate_past_intervals " << i
             << ": not rw,"