]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: consider backfill_pos to be degraded
authorSamuel Just <samuel.just@dreamhost.com>
Sun, 12 Feb 2012 01:50:49 +0000 (17:50 -0800)
committerSage Weil <sage@newdream.net>
Mon, 13 Feb 2012 19:26:52 +0000 (11:26 -0800)
A write may trigger via make_writeable the creation of a clone which
sorts before the object being written.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/ReplicatedPG.cc

index 0212e4f8ff4a46b8bf05c18642284d956576bb0c..8f2974ca24511ebe1b2e2ac19a4b74edb28211c8 100644 (file)
@@ -137,6 +137,12 @@ bool ReplicatedPG::is_degraded_object(const hobject_t& soid)
        peer_missing[peer].missing.count(soid))
       return true;
 
+    // If soid == backfill_pos, we may implicitly write to
+    // the largest snap of soid for make_writeable.
+    if (peer == backfill_target &&
+       backfill_pos == soid)
+      return true;
+
     // Object is degraded if after last_backfill AND
     // we have are backfilling it
     if (peer == backfill_target &&
@@ -5620,6 +5626,13 @@ int ReplicatedPG::recover_backfill(int max)
     if (pbi.begin < backfill_info.begin) {
       dout(20) << " removing peer " << pbi.begin << dendl;
       to_remove[pbi.begin] = pbi.objects.begin()->second;
+      // Object was degraded, but won't be recovered
+      if (waiting_for_degraded_object.count(pbi.begin)) {
+       osd->requeue_ops(
+         this,
+         waiting_for_degraded_object[pbi.begin]);
+       waiting_for_degraded_object.erase(pbi.begin);
+      }
       pbi.pop_front();
       // Don't increment ops here because deletions
       // are cheap and not replied to unlike real recovery_ops,
@@ -5636,6 +5649,13 @@ int ReplicatedPG::recover_backfill(int max)
       } else {
        dout(20) << " keeping peer " << pbi.begin << " "
                 << pbi.objects.begin()->second << dendl;
+       // Object was degraded, but won't be recovered
+       if (waiting_for_degraded_object.count(pbi.begin)) {
+         osd->requeue_ops(
+           this,
+           waiting_for_degraded_object[pbi.begin]);
+         waiting_for_degraded_object.erase(pbi.begin);
+       }
       }
       add_to_stat.insert(pbi.begin);
       backfill_info.pop_front();