return (last_warm_restart > msg_epoch);
}
+void PG::reset_last_warm_restart() {
+ const OSDMap &osdmap = *osd->osdmap;
+ last_warm_restart = osdmap.get_epoch();
+}
+
/* Called before initializing peering during advance_map */
void PG::warm_restart(const OSDMap& lastmap, const vector<int>& newup, const vector<int>& newacting)
{
// -- there was a change! --
kick();
- last_warm_restart = osdmap.get_epoch();
+ reset_last_warm_restart();
vector<int> oldacting, oldup;
int oldrole = get_role();
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;
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 >,
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 {
void share_pg_log(const eversion_t &oldver);
void warm_restart(const OSDMap& lastmap, const vector<int>& newup, const vector<int>& newacting);
+ void reset_last_warm_restart();
void fulfill_info(int from, const Query &query,
pair<int, Info> ¬ify_info);