]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/osd_types: consider CRUSH_ITEM_NONE in check_new_interval() min_size check
authorSage Weil <sage@redhat.com>
Sun, 12 Oct 2014 17:05:51 +0000 (10:05 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 30 Oct 2014 20:46:19 +0000 (13:46 -0700)
Fixes: #9718
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit d947050c82a511f91c98e1c76e48ffa9e187eee7)

Conflicts:
src/osd/osd_types.cc

src/osd/osd_types.cc

index 16bdbaf3417f080037e81f6147e6f972b4999cda..1aced90acccebd98bd17d224e3fa3a9003677219 100644 (file)
@@ -2235,9 +2235,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(pool_id)->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,"