From d746aea74fed7442b686811df24300c81a771a80 Mon Sep 17 00:00:00 2001 From: Alex Ainscow Date: Tue, 1 Jul 2025 15:51:58 +0100 Subject: [PATCH] osd: Relax assertion that all recoveries require a read. If multiple object are being read as part of the same recovery (this happens when recovering some snapshots) and a read fails, then some reads from other shards will be necessary. However, some objects may not need to read. In this case it is only important that at least one read message is sent, rather than one read message per object is sent. Signed-off-by: Alex Ainscow (cherry picked from commit 9f9ea6ddd38ebf6ae7159855267e61858bb2b7fc) --- src/osd/ECCommon.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/ECCommon.cc b/src/osd/ECCommon.cc index 4b1d83b1c5d..8a8ed5f929c 100644 --- a/src/osd/ECCommon.cc +++ b/src/osd/ECCommon.cc @@ -441,6 +441,7 @@ void ECCommon::ReadPipeline::start_read_op( void ECCommon::ReadPipeline::do_read_op(ReadOp &rop) { const int priority = rop.priority; const ceph_tid_t tid = rop.tid; + bool reads_sent = false; dout(10) << __func__ << ": starting read " << rop << dendl; ceph_assert(!rop.to_read.empty()); @@ -448,7 +449,6 @@ void ECCommon::ReadPipeline::do_read_op(ReadOp &rop) { map messages; for (auto &&[hoid, read_request]: rop.to_read) { bool need_attrs = read_request.want_attrs; - ceph_assert(!read_request.shard_reads.empty()); for (auto &&[shard, shard_read]: read_request.shard_reads) { if (need_attrs && !sinfo.is_nonprimary_shard(shard)) { @@ -471,9 +471,11 @@ void ECCommon::ReadPipeline::do_read_op(ReadOp &rop) { for (auto &[start, len]: shard_read.extents) { messages[shard_read.pg_shard].to_read[hoid].emplace_back( boost::make_tuple(start, len, read_request.flags)); + reads_sent = true; } } ceph_assert(!need_attrs); + ceph_assert(reads_sent); } std::vector> m; -- 2.39.5