]> 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)
committerAlex Ainscow <aainscow@uk.ibm.com>
Fri, 25 Jul 2025 07:43:09 +0000 (08:43 +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>
src/osd/PeeringState.cc

index 2413aa4406ed88644b3f773659dde94a4716407b..17842b324f5b457ff10159efb2b3771d4184740d 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());
 }