]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ECBackend::continue_recovery_op: handle a source shard going down 1744/head
authorSamuel Just <sam.just@inktank.com>
Thu, 24 Apr 2014 19:48:44 +0000 (12:48 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 24 Apr 2014 19:48:46 +0000 (12:48 -0700)
get_min_avail_to_read_shards might return an error if there are
no longer enough sources to reconstruct the missing shards.
This is possible if osds went down while we were writing the
previous chunk -- we already notice in check_recovery_sources
if a source goes down during a read.

Fixes: #8161
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ECBackend.cc

index 66b7dd5c56f81eade038c1fb5e38d7d525ae41a3..3c27288c53259e758fcb733cdf717839960bca4e 100644 (file)
@@ -472,6 +472,15 @@ void ECBackend::continue_recovery_op(
       set<pg_shard_t> to_read;
       int r = get_min_avail_to_read_shards(
        op.hoid, want, true, &to_read);
+      if (r != 0) {
+       // we must have lost a recovery source
+       assert(!op.recovery_progress.first);
+       dout(10) << __func__ << ": canceling recovery op for obj " << op.hoid
+                << dendl;
+       get_parent()->cancel_pull(op.hoid);
+       recovery_ops.erase(op.hoid);
+       return;
+      }
       assert(r == 0);
       m->read(
        this,