]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PeeringState: fix wrong history of merge target 30280/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 22 Aug 2019 07:21:17 +0000 (15:21 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 10 Sep 2019 06:44:51 +0000 (08:44 +0200)
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 <xie.xingguo@zte.com.cn>
(cherry picked from commit d47386c3145d3d4c4ace630ce7b48e552c5f2a5a)

Conflicts:
src/osd/PeeringState.cc
- file does not exist in nautilus; made change manually in PG.cc

src/osd/PG.cc

index 8161087bfb4700e1877f018bea978e06b9c6e7ae..3270f72555ab373f7bdb3df106fb35d21fd110bb 100644 (file)
@@ -2877,7 +2877,7 @@ void PG::merge_from(map<spg_t,PGRef>& sources, RecoveryCtx *rctx,
 
   // 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;