]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: break out of Active AdvMap handler if interval change
authorSage Weil <sage@redhat.com>
Fri, 1 Dec 2017 22:15:24 +0000 (16:15 -0600)
committerSage Weil <sage@redhat.com>
Sat, 2 Dec 2017 03:26:49 +0000 (21:26 -0600)
If we are about to lose our primary status, we don't want to do *any*
of this stuff... especially share_pg_info(), which would get tagged with
the current epoch but confuse our peers!

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc

index d3e6a215755c80a5764af68926a665a2219351d2..cbaa90e12c7936f44e211cd5fd5aaa4e702aa524 100644 (file)
@@ -7274,6 +7274,16 @@ PG::RecoveryState::Active::Active(my_context ctx)
 boost::statechart::result PG::RecoveryState::Active::react(const AdvMap& advmap)
 {
   PG *pg = context< RecoveryMachine >().pg;
+  if (pg->should_restart_peering(
+       advmap.up_primary,
+       advmap.acting_primary,
+       advmap.newup,
+       advmap.newacting,
+       advmap.lastmap,
+       advmap.osdmap)) {
+    ldout(pg->cct, 10) << "Active advmap interval change, fast return" << dendl;
+    return forward_event();
+  }
   ldout(pg->cct, 10) << "Active advmap" << dendl;
   if (!pg->pool.newly_removed_snaps.empty()) {
     pg->snap_trimq.union_of(pg->pool.newly_removed_snaps);