]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: Move reset_last_warm_restart to Initial::exit
authorSamuel Just <samuel.just@dreamhost.com>
Mon, 22 Aug 2011 17:09:06 +0000 (10:09 -0700)
committerSamuel Just <samuel.just@dreamhost.com>
Mon, 22 Aug 2011 17:20:33 +0000 (10:20 -0700)
Previously, reset_last_warm_restart was only invoked when handle_create
was used.  This misses cases where the pg is initialized via a Notify,
Log, or Info message.  reset_last_warm_restart will now be called from
the Initial state exit handler in order to handle the other cases.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
src/osd/PG.cc
src/osd/PG.h

index d23251dcf43a7496140c3644362d30fdcbf4dc0a..41e533f09bd529230dba6578df948afe6bb45b70 100644 (file)
@@ -3899,13 +3899,6 @@ PG::RecoveryState::Initial::Initial(my_context ctx) : my_base(ctx) {
   context< RecoveryMachine >().log_enter(state_name);
 }
 
-boost::statechart::result 
-PG::RecoveryState::Initial::react(const Initialize&) {
-  PG *pg = context< RecoveryMachine >().pg;
-  pg->reset_last_warm_restart();
-  return transit< Started >();
-}
-
 boost::statechart::result 
 PG::RecoveryState::Initial::react(const MNotifyRec& notify) {
   PG *pg = context< RecoveryMachine >().pg;
@@ -3930,6 +3923,8 @@ PG::RecoveryState::Initial::react(const MLogRec& i) {
 }
 
 void PG::RecoveryState::Initial::exit() {
+  PG *pg = context< RecoveryMachine >().pg;
+  pg->reset_last_warm_restart();
   context< RecoveryMachine >().log_exit(state_name, enter_time);
 }
 
index 2cf9b9c98e80ca18081e9688db0702e2b8b5cfb2..1460f5d60f430cf0b6d6c253ed4493661cdca536 100644 (file)
@@ -1019,8 +1019,8 @@ public:
       void exit();
 
       typedef boost::mpl::list <
+       boost::statechart::transition< Initialize, Started >,
        boost::statechart::transition< Load, Reset >,
-       boost::statechart::custom_reaction< Initialize >,
        boost::statechart::custom_reaction< MNotifyRec >,
        boost::statechart::custom_reaction< MInfoRec >,
        boost::statechart::custom_reaction< MLogRec >,
@@ -1030,7 +1030,6 @@ public:
       boost::statechart::result react(const MNotifyRec&);
       boost::statechart::result react(const MInfoRec&);
       boost::statechart::result react(const MLogRec&);
-      boost::statechart::result react(const Initialize&);
     };
 
     struct Reset : boost::statechart::state< Reset, RecoveryMachine >, NamedState {