From 64047e1bac2e775a06423a03cfab69b88462538c Mon Sep 17 00:00:00 2001 From: David Zafman Date: Wed, 10 Jan 2018 13:30:41 -0800 Subject: [PATCH] osd: Don't start recovery for missing until active pg state set 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 --- src/osd/PG.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ac1bfe6a98744..e873fa6087a6b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -7093,6 +7093,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(); } @@ -7549,7 +7550,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(); -- 2.39.5