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>
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();
}
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();