]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG::calc_acting: consider newest_update_osd when choosing backfill peers
authorSamuel Just <sam.just@inktank.com>
Thu, 16 Jan 2014 20:04:01 +0000 (12:04 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:39:18 +0000 (14:39 -0800)
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 <sam.just@inktank.com>
src/osd/PG.cc

index a138b7ee85f8e7ae49d76489b43051207ddb8cbe..d3887eda82f90ecce6f2cf388c9f32f19f900e31 100644 (file)
@@ -957,7 +957,15 @@ bool PG::calc_acting(int& newest_update_osd_id, vector<int>& want, vector<int>&
     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 {