From: Samuel Just Date: Mon, 22 Aug 2011 17:09:06 +0000 (-0700) Subject: PG: Move reset_last_warm_restart to Initial::exit X-Git-Tag: v0.34~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93c0565e594ea59d1a09acf54cf0b452d0c65601;p=ceph.git PG: Move reset_last_warm_restart to Initial::exit 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 --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d23251dcf43a..41e533f09bd5 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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); } diff --git a/src/osd/PG.h b/src/osd/PG.h index 2cf9b9c98e80..1460f5d60f43 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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 {