]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: is_degraded may return true for backfill
authorSamuel Just <samuel.just@dreamhost.com>
Sun, 12 Feb 2012 01:53:47 +0000 (17:53 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Mon, 13 Feb 2012 19:18:02 +0000 (11:18 -0800)
If is_degraded returns true for backfill, the object may not be
in any replica's missing set.  Only call start_recovery_op if
we actually started an op.  This bug could cause a stuck
in backfill error.

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

index e42c317af07235615d9a61e724bce57d6439c917..4d720cc4a8065c1210b1477eb25c4ac6f7fd92a2 100644 (file)
@@ -5460,13 +5460,16 @@ int ReplicatedPG::recover_object_replicas(const hobject_t& soid, eversion_t v)
   dout(10) << " ondisk_read_lock for " << soid << dendl;
   obc->ondisk_read_lock();
   
-  start_recovery_op(soid);
-
   // who needs it?  
+  bool started = false;
   for (unsigned i=1; i<acting.size(); i++) {
     int peer = acting[i];
     if (peer_missing.count(peer) &&
        peer_missing[peer].is_missing(soid)) {
+      if (!started) {
+       start_recovery_op(soid);
+       started = true;
+      }
       push_to_replica(obc, soid, peer);
     }
   }