From b15cdc9d86829c945a5339b74b3e5a9181d0e65a 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 acdc801e7bbf7..84707d83f573d 100644 --- a/src/osd/ECCommon.cc +++ b/src/osd/ECCommon.cc @@ -426,6 +426,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()); @@ -433,7 +434,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)) { @@ -456,9 +456,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