]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: FastEC: always update pwlc epoch when activating 66685/head
authorBill Scales <bill_scales@uk.ibm.com>
Thu, 18 Dec 2025 12:45:02 +0000 (12:45 +0000)
committerBill Scales <bill_scales@uk.ibm.com>
Thu, 18 Dec 2025 12:59:49 +0000 (12:59 +0000)
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 <bill_scales@uk.ibm.com>
src/osd/PeeringState.cc

index b6a7ceeec726204c1bf7339701884e04408d01d7..dc41309cedcca6e83986f9bc99b610d150574d65 100644 (file)
@@ -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(