]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: EC Optimizations fix missing call to partial_write
authorBill Scales <bill_scales@uk.ibm.com>
Tue, 20 May 2025 10:37:05 +0000 (11:37 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Tue, 1 Jul 2025 11:57:50 +0000 (12:57 +0100)
When a shard is backfilling and it receives a log entry where the
transaction is not applied it can skip the roll forward by
immediately advancing crt. However it is still necessary to
call partial_write in this scenario to keep the pwlc information
up to date.

Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
src/osd/PGLog.h
src/osd/PeeringState.cc
src/osd/PeeringState.h

index 8978dedf7aee72f5de29c694c99e8f96c769ace1..645eefcba991669f4b2be669a0bd30d4d8506d02 100644 (file)
@@ -626,7 +626,7 @@ public:
     }
 
     // actors
-    void add(const pg_log_entry_t& e, enum NonPrimary nonprimary, bool applied) {
+    void add(const pg_log_entry_t& e, enum NonPrimary nonprimary, bool applied, pg_info_t *info, LogEntryHandler *h) {
       if (!applied) {
         if (!nonprimary) {
           ceph_assert(get_can_rollback_to() == head);
@@ -668,14 +668,14 @@ public:
       }
 
       if (!applied) {
-       skip_can_rollback_to_to_head();
+       skip_can_rollback_to_to_head(info, h);
       }
     } // add
 
     // nonprimary and applied must either both be provided or neither. If
     // neither is provided applied = true and the nonprimary is irrelevant.
     void add(const pg_log_entry_t& e) {
-      add(e, NonPrimaryFalse, true);
+      add(e, NonPrimaryFalse, true, nullptr, nullptr);
     }
 
     void trim(
@@ -845,13 +845,13 @@ public:
 
   void unindex() { log.unindex(); }
 
-  void add(const pg_log_entry_t& e, enum NonPrimary nonprimary, bool applied) {
+  void add(const pg_log_entry_t& e, enum NonPrimary nonprimary, bool applied, pg_info_t *info, LogEntryHandler *h) {
     mark_writeout_from(e.version);
-    log.add(e, nonprimary, applied);
+    log.add(e, nonprimary, applied, info, h);
   }
 
   void add(const pg_log_entry_t& e) {
-    add(e, NonPrimaryFalse, true);
+    add(e, NonPrimaryFalse, true, nullptr, nullptr);
   }
 
   void reset_recovery_pointers() { log.reset_recovery_pointers(); }
index 4021dc6e6a35d757fa493d80887c2821f7f974b1..048224f6ec7c3d2bcba13f3cd6090794aef254e9 100644 (file)
@@ -4500,7 +4500,7 @@ void PeeringState::merge_new_log_entries(
   }
 }
 
-void PeeringState::add_log_entry(const pg_log_entry_t& e, bool applied)
+void PeeringState::add_log_entry(const pg_log_entry_t& e, ObjectStore::Transaction &t, bool applied)
 {
   // raise last_complete only if we were previously up to date
   if (info.last_complete == info.last_update)
@@ -4517,7 +4517,8 @@ void PeeringState::add_log_entry(const pg_log_entry_t& e, bool applied)
 
   // log mutation
   enum PGLog::NonPrimary nonprimary{pool.info.is_nonprimary_shard(info.pgid.shard)};
-  pg_log.add(e, nonprimary, applied);
+  PGLog::LogEntryHandlerRef handler{pl->get_log_handler(t)};
+  pg_log.add(e, nonprimary, applied, &info, handler.get());
   psdout(10) << "add_log_entry " << e << dendl;
 }
 
@@ -4573,7 +4574,7 @@ void PeeringState::append_log(
   }
 
   for (auto p = logv.begin(); p != logv.end(); ++p) {
-    add_log_entry(*p, transaction_applied);
+    add_log_entry(*p, t, transaction_applied);
 
     /* We don't want to leave the rollforward artifacts around
      * here past last_backfill.  It's ok for the same reason as
index 2f1dda828c4e516d33014a2dcd328d2c5a506267..e13a95720ad1eabac994d2831e7a562fb5960f32 100644 (file)
@@ -1787,7 +1787,7 @@ private:
   void update_blocked_by();
   void update_calc_stats();
 
-  void add_log_entry(const pg_log_entry_t& e, bool applied);
+  void add_log_entry(const pg_log_entry_t& e, ObjectStore::Transaction &t, bool applied);
 
   void calc_trim_to();
   void calc_trim_to_aggressive();