]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: clear want_acting when we leave Primary
authorSamuel Just <sam.just@inktank.com>
Thu, 25 Apr 2013 21:08:57 +0000 (14:08 -0700)
committerSamuel Just <sam.just@inktank.com>
Thu, 25 Apr 2013 23:24:41 +0000 (16:24 -0700)
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>
src/osd/PG.cc

index 70e2a326d2af2aa9c12cb6520a9030ef95d9851a..c1155c33bbe1b5da571dfce0d1c0819857ab3070 100644 (file)
@@ -4998,7 +4998,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) {
@@ -6005,6 +6004,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)
@@ -6040,6 +6041,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--------*/