]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "ReplicatedPG::recover_backfill: do not update last_backfill prematurely"
authorSamuel Just <sam.just@inktank.com>
Wed, 8 Oct 2014 22:54:34 +0000 (15:54 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 8 Oct 2014 22:54:46 +0000 (15:54 -0700)
I'm going to backport the full version of this patch.

This reverts commit d4e67ff3037a3cc7ae2ecc9e1d8d086c45ae515a.

src/osd/ReplicatedPG.cc

index 816c49040e16714637bde32a9762081b6f0df891..2e8a1d991f8cd3c8b2c977df53eb2daf1d1d167c 100644 (file)
@@ -7473,23 +7473,18 @@ int ReplicatedPG::recover_backfill(
     dout(20) << *i << " is still in flight" << dendl;
   }
 
-  hobject_t next_to_complete = backfills_in_flight.size() ?
+  hobject_t bound = backfills_in_flight.size() ?
     *(backfills_in_flight.begin()) : backfill_pos;
-  hobject_t pending_last_backfill = pinfo.last_backfill;
-  for (map<hobject_t, pg_stat_t>::iterator i = pending_backfill_updates.begin();
-       i != pending_backfill_updates.end() && i->first < next_to_complete;
-       pending_backfill_updates.erase(i++)) {
-    pinfo.stats.add(i->second);
-    pending_last_backfill = i->first;
-  }
-  if (backfills_in_flight.empty() && backfill_pos.is_max())
-    pending_last_backfill = hobject_t::get_max();
-
-  if (pending_last_backfill > pinfo.last_backfill) {
-    pinfo.last_backfill = pending_last_backfill;
+  if (bound > pinfo.last_backfill) {
+    pinfo.last_backfill = bound;
+    for (map<hobject_t, pg_stat_t>::iterator i = pending_backfill_updates.begin();
+        i != pending_backfill_updates.end() && i->first < bound;
+        pending_backfill_updates.erase(i++)) {
+      pinfo.stats.add(i->second);
+    }
     epoch_t e = get_osdmap()->get_epoch();
     MOSDPGBackfill *m = NULL;
-    if (pinfo.last_backfill.is_max()) {
+    if (bound.is_max()) {
       m = new MOSDPGBackfill(MOSDPGBackfill::OP_BACKFILL_FINISH, e, e, info.pgid);
       // Use default priority here, must match sub_op priority
       /* pinfo.stats might be wrong if we did log-based recovery on the
@@ -7501,7 +7496,7 @@ int ReplicatedPG::recover_backfill(
       m = new MOSDPGBackfill(MOSDPGBackfill::OP_BACKFILL_PROGRESS, e, e, info.pgid);
       // Use default priority here, must match sub_op priority
     }
-    m->last_backfill = pinfo.last_backfill;
+    m->last_backfill = bound;
     m->stats = pinfo.stats;
     osd->send_message_osd_cluster(backfill_target, m, get_osdmap()->get_epoch());
   }