]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: avoid choose_acting picking want with > pool size items 24035/head
authorSage Weil <sage@redhat.com>
Tue, 11 Sep 2018 16:12:22 +0000 (11:12 -0500)
committerSage Weil <sage@redhat.com>
Tue, 11 Sep 2018 16:12:22 +0000 (11:12 -0500)
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>
src/osd/PG.cc

index a2466a99cb7d330a112f13ec098356e06ce3752a..35c33db309cf4aac2e2a0e5f5019dc068e4190a4 100644 (file)
@@ -1400,6 +1400,9 @@ void PG::calc_replicated_acting(
       acting_backfill->insert(up_cand);
       ss << " osd." << i << " (up) accepted " << cur_info << std::endl;
     }
+    if (want->size() >= size) {
+      break;
+    }
   }
 
   if (want->size() >= size) {