From: Samuel Just Date: Thu, 16 Jan 2014 20:04:01 +0000 (-0800) Subject: PG::calc_acting: consider newest_update_osd when choosing backfill peers X-Git-Tag: v0.78~286^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96d4a0c26ebae3d74518a0347ed5b79b4b175453;p=ceph.git PG::calc_acting: consider newest_update_osd when choosing backfill peers We must include newest_update_osd->second.log_tail when considering backfill peers because in GetLog we will request logs back to the min last_update over our acting_backfill set. This will result in our log being extended as far backwards as necessary to pick up any peers which can be log recovered by the union of newest_update_osd's log and that of the chosen primary. Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index a138b7ee85f8..d3887eda82f9 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -957,7 +957,15 @@ bool PG::calc_acting(int& newest_update_osd_id, vector& want, vector& if (*i == primary->first) continue; const pg_info_t &cur_info = all_info.find(*i)->second; - if (cur_info.is_incomplete() || cur_info.last_update < primary->second.log_tail) { + if (cur_info.is_incomplete() || + cur_info.last_update < MIN( + primary->second.log_tail, + newest_update_osd->second.log_tail)) { + /* We include newest_update_osd->second.log_tail because in GetLog, + * we will request logs back to the min last_update over our + * acting_backfill set, which will result in our log being extended + * as far backwards as necessary to pick up any peers which can + * be log recovered by newest_update_osd's log */ dout(10) << " osd." << *i << " (up) backfill " << cur_info << dendl; backfill.push_back(*i); } else {