From: Samuel Just Date: Thu, 25 Apr 2013 21:08:57 +0000 (-0700) Subject: PG: clear want_acting when we leave Primary X-Git-Tag: v0.56.5~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a28c2f55bfc768a502fbc8ec35265e7f1a53e044;p=ceph.git PG: clear want_acting when we leave Primary 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 Reviewed-by: Sage Weil Reviewed-by: David Zafman (cherry picked from commit a5cade1fe7338602fb2bbfa867433d825f337c87) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 0ad4fdfb8af2..7f49bb0bcab2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4724,7 +4724,6 @@ void PG::start_peering_interval(const OSDMapRef lastmap, up = newup; acting = newacting; - want_acting.clear(); if (info.stats.up != up || info.stats.acting != acting) { @@ -5448,6 +5447,8 @@ PG::RecoveryState::Primary::Primary(my_context ctx) { 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) @@ -5484,6 +5485,8 @@ boost::statechart::result PG::RecoveryState::Primary::react(const ActMap&) void PG::RecoveryState::Primary::exit() { context< RecoveryMachine >().log_exit(state_name, enter_time); + PG *pg = context< RecoveryMachine >().pg; + pg->want_acting.clear(); } /*---------Peering--------*/