From: Bill Scales Date: Tue, 20 May 2025 10:37:05 +0000 (+0100) Subject: osd: EC Optimizations fix missing call to partial_write X-Git-Tag: v20.1.0~68^2~28 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b997d00b7ea7abc87696a316c09d2546aac9e448;p=ceph.git osd: EC Optimizations fix missing call to partial_write 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 (cherry picked from commit ddc306255868f26ae0a3951710ef18207fff9b30) --- diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h index 8978dedf7ae..645eefcba99 100644 --- a/src/osd/PGLog.h +++ b/src/osd/PGLog.h @@ -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(); } diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 585b4a3b793..6cf7d29910f 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -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 diff --git a/src/osd/PeeringState.h b/src/osd/PeeringState.h index 82c0082bb6e..ed531b7d121 100644 --- a/src/osd/PeeringState.h +++ b/src/osd/PeeringState.h @@ -1785,7 +1785,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();