]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Attribute re-reads in optimised EC
authorAlex Ainscow <aainscow@uk.ibm.com>
Mon, 14 Jul 2025 15:40:22 +0000 (16:40 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Sun, 7 Sep 2025 23:10:41 +0000 (00:10 +0100)
There were some bugs in attribute reads during recovery in optimised
EC where the attribute read failed. There were two scenarios:

1. It was not necessary to do any further reads to recover the data. This
can happen during recovery of many shards.
2. The re-read could be honoured from non-primary shards. There are
sometimes multiple copies of the shard whcih can be used, so a failed read
on one OSD can be replaced by a read from another.

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
(cherry picked from commit 417fb71c9b5628726d3217909ba1b6d3e7bf251a)

src/osd/ECBackend.cc
src/osd/ECCommon.cc

index 356859ef9da51484cd89b60f74e248d154001b98..514793ef063b5d765f223cabbfcdace2e6400200 100644 (file)
@@ -1319,8 +1319,12 @@ void ECBackend::handle_sub_read_reply(
         rop.to_read.at(oid).zeros_for_decode.populate_shard_id_set(have);
       }
 
-      int err = ec_impl->minimum_to_decode(want_to_read, have, dummy_minimum,
-                                            nullptr);
+      int err = -EIO; // If attributes needed but not read.
+      if (!rop.to_read.at(oid).want_attrs || rop.complete.at(oid).attrs) {
+        err = ec_impl->minimum_to_decode(want_to_read, have, dummy_minimum,
+                                                    nullptr);
+      }
+
       if (err) {
         dout(20) << __func__ << " minimum_to_decode failed" << dendl;
         if (all_sub_reads_done) {
index 84707d83f573d92d574623d8977696ce291889d1..abe3a2bf0b7aed90081602df3f70b0ec5fc6efcb 100644 (file)
@@ -346,6 +346,7 @@ int ECCommon::ReadPipeline::get_remaining_shards(
   }
 
   bool need_attr_request = want_attrs;
+  read_request.want_attrs = want_attrs;
 
   // Rather than repeating whole read, we can remove everything we already have.
   for (auto iter = read_request.shard_reads.begin();