From 517ddf8435053dad01f5a86d61b75dc74f460ce4 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 22 Dec 2011 17:17:40 -0800 Subject: [PATCH] ReplicatedPG: only pull in one backfill peer at a time Signed-off-by: Samuel Just --- src/osd/PG.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c32bb795ee7..e92a79a3611 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -993,6 +993,7 @@ void PG::calc_acting(int& newest_update_osd_id, vector& want) const << " with " << primary->second << dendl; want.push_back(primary->first); unsigned usable = 1; + unsigned backfill = 0; // select replicas that have log contiguity with primary for (vector::const_iterator i = up.begin(); @@ -1002,8 +1003,13 @@ void PG::calc_acting(int& newest_update_osd_id, vector& want) const continue; const Info &cur_info = all_info.find(*i)->second; if (cur_info.is_incomplete() || cur_info.last_update < primary->second.log_tail) { - dout(10) << " osd." << *i << " (up) accepted (backfill) " << cur_info << dendl; - want.push_back(*i); + if (backfill < 1) { + dout(10) << " osd." << *i << " (up) accepted (backfill) " << cur_info << dendl; + want.push_back(*i); + backfill++; + } else { + dout(10) << " osd." << *i << " (up) rejected" << cur_info << dendl; + } } else { want.push_back(*i); usable++;