From: Bill Scales Date: Thu, 18 Dec 2025 12:45:02 +0000 (+0000) Subject: osd: FastEC: always update pwlc epoch when activating X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bbe6f4fc9756eb3016bb89d87b45a6ff38462c46;p=ceph.git osd: FastEC: always update pwlc epoch when activating Currently the code updates the pwlc epoch at the end of proc_master_log which runs during peering whenever the primary selects a different shard as the source of the definitive log, however this code does not run if the primary selects itself as having the definitive log. Move this to the start of activate so the pwlc epoch is always updated. This ensures that the version of pwlc used by the primary during peering becomes the definitive copy as the primary distributes this to the other shards that are being activated. This fixes 74218 where another shard being activated rolled forward and completed a log update generating pwlc with the current epoch and then went on to merge other log entries provided by the primary and discarded the primary's pwlc because it had an older epoch. Updating the epoch on the primary's pwlc makes sure the shard keeps this copy of pwlc. Fixes: https://tracker.ceph.com/issues/74218 Signed-off-by: Bill Scales --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index b6a7ceeec72..dc41309cedc 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2909,6 +2909,10 @@ void PeeringState::activate( send_notify = false; if (is_primary()) { + // Update the epoch so that pwlc used by the primary during + // peering becomes the definitive copy of pwlc + info.partial_writes_last_complete_epoch = get_osdmap_epoch(); + // only update primary last_epoch_started if we will go active if (acting_set_writeable()) { ceph_assert(cct->_conf->osd_find_best_info_ignore_history_les || @@ -3364,9 +3368,6 @@ void PeeringState::consider_rollback_pwlc(eversion_t last_complete) << info.partial_writes_last_complete[shard] << dendl; } } - // Update the epoch so that pwlc adjustments made by the whole - // proc_master_log process are recognized as the newest updates - info.partial_writes_last_complete_epoch = get_osdmap_epoch(); } void PeeringState::proc_master_log(