From f2b1ed81b2719bd99957cc112e393b84855f93a3 Mon Sep 17 00:00:00 2001 From: Bill Scales Date: Wed, 16 Jul 2025 15:05:16 +0100 Subject: [PATCH] osd: Optimized EC add_log_entry should not skip partial writes Undo a previous attempt at a fix that made add_log_entry skip adding partial writes to the log if the write did not update this shard. The only case where this code path executed is when a partial write was to an object that needs backfilling or async recovery. For async recovery we need to keep the log entry because it is needed to update the missing list. For backfill it doesn't harm to keep the log entry. Signed-off-by: Bill Scales (cherry picked from commit 9f0e883b710a06e3371bc7e0681e034727447f27) --- src/osd/PeeringState.cc | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 3b9a7c195ce..0fad28eff61 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -4575,20 +4575,7 @@ void PeeringState::add_log_entry(const pg_log_entry_t& e, ObjectStore::Transacti // log mutation enum PGLog::NonPrimary nonprimary{pool.info.is_nonprimary_shard(info.pgid.shard)}; PGLog::LogEntryHandlerRef handler{pl->get_log_handler(t)}; - /* Normally an unwritten shard does not get told about a log entry. However - * there are exceptions - in these cases we want to skip adding the entry - * to the log. - */ - if (e.is_written_shard(pg_whoami.shard)) { - pg_log.add(e, nonprimary, applied, &info, handler.get()); - psdout(10) << "add_log_entry " << e << dendl; - } else { - psdout(10) << "add_log_entry skipping partial write " << e << dendl; - eversion_t head = pg_log.get_head(); - ceph_assert(e.version > head); - ceph_assert(head.version == 0 || e.version.version > head.version); - pg_log.set_head(e.version); - } + pg_log.add(e, nonprimary, applied, &info, handler.get()); } -- 2.39.5