Skip to content

Commit 6365803

Browse files
committed
osd: Clear zero_for_decode for shards where read failed on recovery
Not clearing this can lead to a failed decode, which panics, rather than a recovery or IO failure. Signed-off-by: Alex Ainscow <[email protected]>
1 parent b4ab3b1 commit 6365803

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/osd/ECBackend.cc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -707,13 +707,10 @@ void ECBackend::handle_sub_read_reply(
707707
rop.debug_log.emplace_back(ECUtil::ERROR, op.from, complete.buffers_read);
708708
complete.buffers_read.erase_shard(from.shard);
709709
complete.processed_read_requests.erase(from.shard);
710-
// If we are doing redundant reads, then we must take care that any failed
711-
// reads are not replaced with a zero buffer. When fast_reads are disabled,
712-
// the send_all_remaining_reads() call will replace the zeros_for_decode
713-
// based on the recovery read.
714-
if (rop.do_redundant_reads) {
715-
rop.to_read.at(hoid).zeros_for_decode.erase(from.shard);
716-
}
710+
// If there was an error for non-zero data on this shard, then we must also
711+
// ignore all zeros, or minimum_to_decode may conclude that it has enough
712+
// shards available.
713+
rop.to_read.at(hoid).zeros_for_decode.erase(from.shard);
717714
dout(20) << __func__ << " shard=" << from << " error=" << err << dendl;
718715
}
719716

0 commit comments

Comments
 (0)