From c2b97811b2adc795d07fcc1be3df73ffd4061879 Mon Sep 17 00:00:00 2001 From: Bill Scales Date: Fri, 11 Jul 2025 12:59:40 +0100 Subject: [PATCH] osd: EC optimizations keep log entries on all shards When a shard is backfilling it gets given log entries for partial writes even if they do not apply to the shard. The code was updating the missing list but discarding the log entry. This is wrong because the update can be rolled backwards and the log entry is required to revert the update to the missing list. Keeping the log entry has a small but insignificant performance impact. Signed-off-by: Bill Scales (cherry picked from commit 1fa5302092cbbb37357142d01ca008cae29d4f5e) --- src/osd/PGLog.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 4ece20c0e1355..1430f94965839 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -1404,11 +1404,7 @@ public: invalidate_stats = invalidate_stats || !p->is_error(); if (log) { ldpp_dout(dpp, 20) << "update missing, append " << *p << dendl; - // Skip the log entry if it is a partial write that did not involve - // this shard - if (!pool.is_nonprimary_shard(shard) || p->is_written_shard(shard)) { - log->add(*p); - } + log->add(*p); } if (p->soid <= last_backfill && !p->is_error()) { -- 2.39.5