This is somewhat annoying actually. Intuitively we want to
clear_primary_state when we leave primary, but when we restart
peering due to a change in prior set status, we can't afford
to forget most of our peering state. want_acting, on the
other hand, should never persist across peering attempts.
In fact, in the future, want_acting should be pulled into
the Primary state structure.
Fixes: #3904
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit
a5cade1fe7338602fb2bbfa867433d825f337c87)
up = newup;
acting = newacting;
- want_acting.clear();
if (info.stats.up != up ||
info.stats.acting != acting) {
{
state_name = "Started/Primary";
context< RecoveryMachine >().log_enter(state_name);
+ PG *pg = context< RecoveryMachine >().pg;
+ assert(pg->want_acting.empty());
}
boost::statechart::result PG::RecoveryState::Primary::react(const AdvMap &advmap)
void PG::RecoveryState::Primary::exit()
{
context< RecoveryMachine >().log_exit(state_name, enter_time);
+ PG *pg = context< RecoveryMachine >().pg;
+ pg->want_acting.clear();
}
/*---------Peering--------*/