]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: avoid choose_acting picking want with > pool size items 24299/head
authorSage Weil <sage@redhat.com>
Tue, 11 Sep 2018 16:12:22 +0000 (11:12 -0500)
committerPrashant D <pdhange@redhat.com>
Thu, 27 Sep 2018 03:49:53 +0000 (23:49 -0400)
If the pool size recently changed, we might see an up that is larger than
the pool size.  Or, we might already have selected a primary that is not
part of up, and then add all up osds and end up with a want that is too
big.

Fixes: http://tracker.ceph.com/issues/35924
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit c3e2990c39952a1fc4593076c5b2f0dea6cdcdd3)

src/osd/PG.cc

index 0f0781e954cb5729c7e536e89527dd3b916a4591..95a9b7f64d2ccb73ad2f06e72cc2f314f7504d00 100644 (file)
@@ -1356,6 +1356,9 @@ void PG::calc_replicated_acting(
       usable++;
       ss << " osd." << *i << " (up) accepted " << cur_info << std::endl;
     }
+    if (want->size() >= size) {
+      break;
+    }
   }
 
   // This no longer has backfill OSDs, but they are covered above.