]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Don't start recovery for missing until active pg state set
authorDavid Zafman <dzafman@redhat.com>
Wed, 10 Jan 2018 21:30:41 +0000 (13:30 -0800)
committerDavid Zafman <dzafman@redhat.com>
Mon, 22 Jan 2018 18:43:23 +0000 (10:43 -0800)
I was seeing recovery hang when it is started before _activate_committed()
The state machine passes into "Active" but this transitions to activating
pg state and after commmitted into "active" pg state.

Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 64047e1bac2e775a06423a03cfab69b88462538c)

src/osd/PG.cc

index 081229eeadc8b07ea98e98698742b7c1dacc6ec1..acf8892dac3006ab634ae99a870494dc2e7a80e5 100644 (file)
@@ -7008,6 +7008,7 @@ PG::RecoveryState::Recovering::Recovering(my_context ctx)
   pg->state_clear(PG_STATE_RECOVERY_WAIT);
   pg->state_clear(PG_STATE_RECOVERY_TOOFULL);
   pg->state_set(PG_STATE_RECOVERING);
+  assert(!pg->state_test(PG_STATE_ACTIVATING));
   pg->publish_stats_to_osd();
   pg->queue_recovery();
 }
@@ -7363,7 +7364,8 @@ boost::statechart::result PG::RecoveryState::Active::react(const MLogRec& logevt
     pg->peer_missing[logevt.from],
     logevt.from,
     context< RecoveryMachine >().get_recovery_ctx());
-  if (got_missing) {
+  // If there are missing AND we are "fully" active then start recovery now
+  if (got_missing && pg->state_test(PG_STATE_ACTIVE)) {
     post_event(DoRecovery());
   }
   return discard_event();