From: xie xingguo Date: Thu, 22 Aug 2019 07:21:17 +0000 (+0800) Subject: osd/PeeringState: fix wrong history of merge target X-Git-Tag: v15.1.0~1698^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d47386c3145d3d4c4ace630ce7b48e552c5f2a5a;p=ceph.git osd/PeeringState: fix wrong history of merge target The merge target could be a stray pg that has never got the chance to finish a complete peering cycle (we never purge strays before merge is done) and hence leaving a zeroed last_epoch_started in the info. In case the merge target incorrectly absorbs an invalid history in, e.g., from an actual placeholder merge source pg, use history.epoch_created == 0 to identify if the merge target is truly a placeholder instead. Fixes: https://tracker.ceph.com/issues/37654 Signed-off-by: xie xingguo --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 01e4e3c1ce18..b8d2ff4edec8 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -2796,7 +2796,7 @@ void PeeringState::merge_from( // make sure we have a meaningful last_epoch_started/clean (if we were a // placeholder) - if (info.last_epoch_started == 0) { + if (info.history.epoch_created == 0) { // start with (a) source's history, since these PGs *should* have been // remapped in concert with each other... info.history = sources.begin()->second->info.history;