]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Optimized EC add_log_entry should not skip partial writes
authorBill Scales <bill_scales@uk.ibm.com>
Wed, 16 Jul 2025 14:05:16 +0000 (15:05 +0100)
committerJon <jonathan.bailey1@ibm.com>
Fri, 3 Oct 2025 13:31:24 +0000 (14:31 +0100)
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 <bill_scales@uk.ibm.com>
(cherry picked from commit 9f0e883b710a06e3371bc7e0681e034727447f27)

src/osd/PeeringState.cc

index 3b9a7c195ced18f936f045e05c6dd22d73ab3975..0fad28eff615eb885f9543631a1cba151bd37cab 100644 (file)
@@ -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());
 }