From cf3dc4ac300b20d07ea4f6870ceda32336f6ee41 Mon Sep 17 00:00:00 2001 From: Alex Ainscow Date: Fri, 1 Aug 2025 15:09:58 +0100 Subject: [PATCH] osd: Do not sent PDWs if read count > k The main point of PDW (as currently implemented) is to reduce the amount of reading performed by the primary when preparing for a read-modify-write (RMW). It was making the assumption that if any recovery was required by a conventional RMW, then a PDW is always better. This was an incorrect assumption as a conventional RMW performs at most K reads for any plugin which supports PDW. As such, we tweak this logic to perform a conventional RMW if the PDW is going to read k or more shards. This should improve performance in some minor areas. Signed-off-by: Alex Ainscow (cherry picked from commit cffd10f3cc82e0aef29209e6e823b92bdb0291ce) --- src/osd/ECTransaction.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osd/ECTransaction.cc b/src/osd/ECTransaction.cc index 33e4f063ec8..b3568794124 100644 --- a/src/osd/ECTransaction.cc +++ b/src/osd/ECTransaction.cc @@ -213,6 +213,10 @@ ECTransaction::WritePlanObj::WritePlanObj( if (pdw_write_mode != 0) { do_parity_delta_write = (pdw_write_mode == 2); + } else if (pdw_read_shards.size() >= sinfo.get_k()) { + // Even if recovery required for a convention RMW, PDW is not more + // efficient. + do_parity_delta_write = false; } else if (!shard_id_set::difference(pdw_read_shards, readable_shards).empty()) { // Some kind of reconstruct would be needed for PDW, so don't bother. do_parity_delta_write = false; -- 2.39.5