From 264faa590c85e141257d0b1dc1d3c798f5e4280a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 11 Sep 2018 11:12:22 -0500 Subject: [PATCH] osd/PG: avoid choose_acting picking want with > pool size items 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 (cherry picked from commit c3e2990c39952a1fc4593076c5b2f0dea6cdcdd3) --- src/osd/PG.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 0f0781e954c..95a9b7f64d2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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. -- 2.47.3