Skip to content

Commit

Permalink
osd/PG: perfer EC async_recovery_targets in reverse order of cost
Browse files Browse the repository at this point in the history
This is a follow-up fix of ceph/ceph#21578,
in which I forget that erasure-coded-pools share the same logic
when determining the async_recovery_targets..

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 441876f)
  • Loading branch information
xiexingguo committed Jul 24, 2018
1 parent 5520b6f commit d80ec7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1451,8 +1451,9 @@ void PG::choose_async_recovery_ec(const map<pg_shard_t, pg_info_t> &all_info,
<< dendl;

// take out as many osds as we can for async recovery, in order of cost
for (auto weighted_shard : candidates_by_cost) {
pg_shard_t cur_shard = weighted_shard.second;
for (auto rit = candidates_by_cost.rbegin();
rit != candidates_by_cost.rend(); ++rit) {
pg_shard_t cur_shard = rit->second;
vector<int> candidate_want(*want);
candidate_want[cur_shard.shard.id] = CRUSH_ITEM_NONE;
if (recoverable_and_ge_min_size(candidate_want)) {
Expand Down

0 comments on commit d80ec7e

Please sign in to comment.