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>
(cherry picked from commit
1885792c517670086332a8bab237c58558ee6dda)
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,