]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: want set size should not be below min_size
authorNeha Ojha <nojha@redhat.com>
Thu, 22 Feb 2018 22:09:45 +0000 (14:09 -0800)
committerNeha Ojha <nojha@redhat.com>
Thu, 15 Mar 2018 18:13:34 +0000 (11:13 -0700)
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/PG.cc

index e82d250e00a49ae3a7358339c4b97f3537e132cd..8fa38b163be96dbc14ae3863fbf9007d0e7404f3 100644 (file)
@@ -1571,9 +1571,11 @@ void PG::choose_async_recovery_replicated(const map<pg_shard_t, pg_info_t> &all_
 
   dout(20) << __func__ << " candidates by cost are: " << candidates_by_cost
            << dendl;
-
   // take out as many osds as we can for async recovery, in order of cost
   for (auto weighted_shard : candidates_by_cost) {
+    if (want->size() <= pool.info.min_size) {
+      break;
+    }
     pg_shard_t cur_shard = weighted_shard.second;
     vector<int> candidate_want(*want);
     for (auto it = candidate_want.begin(); it != candidate_want.end(); ++it) {
@@ -1584,9 +1586,6 @@ void PG::choose_async_recovery_replicated(const map<pg_shard_t, pg_info_t> &all_
         break;
       }
     }
-    if (want->size() <= pool.info.min_size) {
-      break;
-    }
   }
   dout(20) << __func__ << " result want=" << *want
            << " async_recovery=" << *async_recovery << dendl;