]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Relax assertion that all recoveries require a read.
authorAlex Ainscow <aainscow@uk.ibm.com>
Tue, 1 Jul 2025 14:51:58 +0000 (15:51 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Sun, 7 Sep 2025 23:10:41 +0000 (00:10 +0100)
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 <aainscow@uk.ibm.com>
(cherry picked from commit 9f9ea6ddd38ebf6ae7159855267e61858bb2b7fc)

src/osd/ECCommon.cc

index acdc801e7bbf749e2bc859d9128f5943f8c398b5..84707d83f573d92d574623d8977696ce291889d1 100644 (file)
@@ -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<pg_shard_t, ECSubRead> 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<std::pair<int, Message*>> m;