peer_missing_requested.clear();
}
+void PeeringState::query_unfound(Formatter *f, string state)
+{
+ psdout(20) << "Enter PeeringState common QueryUnfound" << dendl;
+ {
+ f->dump_string("state", state);
+ f->dump_bool("available_might_have_unfound", true);
+ f->open_array_section("might_have_unfound");
+ for (auto p = might_have_unfound.begin();
+ p != might_have_unfound.end();
+ ++p) {
+ if (peer_missing.count(*p)) {
+ ; // Ignore already probed OSDs
+ } else {
+ f->open_object_section("osd");
+ f->dump_stream("osd") << *p;
+ if (peer_missing_requested.count(*p)) {
+ f->dump_string("status", "querying");
+ } else if (!get_osdmap()->is_up(p->osd)) {
+ f->dump_string("status", "osd is down");
+ } else {
+ f->dump_string("status", "not queried");
+ }
+ f->close_section();
+ }
+ }
+ f->close_section();
+ }
+ psdout(20) << "Exit PeeringState common QueryUnfound" << dendl;
+ return;
+}
bool PeeringState::proc_replica_info(
pg_shard_t from, const pg_info_t &oinfo, epoch_t send_epoch)
return discard_event();
}
+boost::statechart::result PeeringState::Started::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "Started");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::Started::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return discard_event();
}
+boost::statechart::result PeeringState::Reset::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "Reset");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::Reset::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::Peering::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "Peering");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::Peering::exit()
{
pl->publish_stats_to_osd();
}
+boost::statechart::result PeeringState::NotBackfilling::react(const QueryUnfound& q)
+{
+ DECLARE_LOCALS;
+
+ ps->query_unfound(q.f, "NotBackfilling");
+ return discard_event();
+}
+
boost::statechart::result
PeeringState::NotBackfilling::react(const RemoteBackfillReserved &evt)
{
pl->publish_stats_to_osd();
}
+boost::statechart::result PeeringState::NotRecovering::react(const QueryUnfound& q)
+{
+ DECLARE_LOCALS;
+
+ ps->query_unfound(q.f, "NotRecovering");
+ return discard_event();
+}
+
void PeeringState::NotRecovering::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::Active::react(const QueryUnfound& q)
+{
+ DECLARE_LOCALS;
+
+ ps->query_unfound(q.f, "Active");
+ return discard_event();
+}
+
boost::statechart::result PeeringState::Active::react(
const ActivateCommitted &evt)
{
return forward_event();
}
+boost::statechart::result PeeringState::ReplicaActive::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "ReplicaActive");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::ReplicaActive::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::GetInfo::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "GetInfo");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::GetInfo::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::GetLog::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "GetLog");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::GetLog::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::WaitActingChange::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "WaitActingChange");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::WaitActingChange::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::Down::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "Down");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
boost::statechart::result PeeringState::Down::react(const MNotifyRec& infoevt)
{
DECLARE_LOCALS;
return forward_event();
}
+boost::statechart::result PeeringState::Incomplete::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "Incomplete");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::Incomplete::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::GetMissing::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "GetMising");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::GetMissing::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
return forward_event();
}
+boost::statechart::result PeeringState::WaitUpThru::react(const QueryUnfound& q)
+{
+ q.f->dump_string("state", "WaitUpThru");
+ q.f->dump_bool("available_might_have_unfound", false);
+ return discard_event();
+}
+
void PeeringState::WaitUpThru::exit()
{
context< PeeringMachine >().log_exit(state_name, enter_time);
}
};
+ struct QueryUnfound : boost::statechart::event< QueryUnfound > {
+ ceph::Formatter *f;
+ explicit QueryUnfound(ceph::Formatter *f) : f(f) {}
+ void print(std::ostream *out) const {
+ *out << "QueryUnfound";
+ }
+ };
+
struct AdvMap : boost::statechart::event< AdvMap > {
OSDMapRef osdmap;
OSDMapRef lastmap;
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< AdvMap >,
boost::statechart::custom_reaction< ActMap >,
boost::statechart::custom_reaction< NullEvt >,
boost::statechart::transition< boost::statechart::event_base, Crashed >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const ActMap&);
boost::statechart::result react(const IntervalFlush&);
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< AdvMap >,
boost::statechart::custom_reaction< IntervalFlush >,
// ignored
boost::statechart::transition< boost::statechart::event_base, Crashed >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const IntervalFlush&);
boost::statechart::result react(const boost::statechart::event_base&) {
NamedState {
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< AdvMap >,
boost::statechart::custom_reaction< MLogRec >,
boost::statechart::custom_reaction< MInfoRec >,
> reactions;
explicit WaitActingChange(my_context ctx);
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const MLogRec&);
boost::statechart::result react(const MInfoRec&);
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::transition< Activate, Active >,
boost::statechart::custom_reaction< AdvMap >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const AdvMap &advmap);
};
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< ActMap >,
boost::statechart::custom_reaction< AdvMap >,
boost::statechart::custom_reaction< MInfoRec >,
boost::statechart::custom_reaction< CheckReadable>
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const ActMap&);
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const MInfoRec& infoevt);
struct NotBackfilling : boost::statechart::state< NotBackfilling, Active>, NamedState {
typedef boost::mpl::list<
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::transition< RequestBackfill, WaitLocalBackfillReserved>,
boost::statechart::custom_reaction< RemoteBackfillReserved >,
boost::statechart::custom_reaction< RemoteReservationRejectedTooFull >
> reactions;
explicit NotBackfilling(my_context ctx);
void exit();
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const RemoteBackfillReserved& evt);
boost::statechart::result react(const RemoteReservationRejectedTooFull& evt);
};
struct NotRecovering : boost::statechart::state< NotRecovering, Active>, NamedState {
typedef boost::mpl::list<
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >,
boost::statechart::custom_reaction< DeferRecovery >,
boost::statechart::custom_reaction< UnfoundRecovery >
> reactions;
explicit NotRecovering(my_context ctx);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const DeferRecovery& evt) {
/* no-op */
return discard_event();
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< ActMap >,
boost::statechart::custom_reaction< MQuery >,
boost::statechart::custom_reaction< MInfoRec >,
boost::statechart::custom_reaction< MLease >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const MInfoRec& infoevt);
boost::statechart::result react(const MLogRec& logevt);
boost::statechart::result react(const MTrim& trimevt);
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::transition< GotInfo, GetLog >,
boost::statechart::custom_reaction< MNotifyRec >,
boost::statechart::transition< IsDown, Down >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const MNotifyRec& infoevt);
};
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< MLogRec >,
boost::statechart::custom_reaction< GotLog >,
boost::statechart::custom_reaction< AdvMap >,
> reactions;
boost::statechart::result react(const AdvMap&);
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const MLogRec& logevt);
boost::statechart::result react(const GotLog&);
};
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< MLogRec >,
boost::statechart::transition< NeedUpThru, WaitUpThru >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const MLogRec& logevt);
};
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< ActMap >,
boost::statechart::custom_reaction< MLogRec >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const ActMap& am);
boost::statechart::result react(const MLogRec& logrec);
};
explicit Down(my_context ctx);
typedef boost::mpl::list <
boost::statechart::custom_reaction< QueryState >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< MNotifyRec >
> reactions;
boost::statechart::result react(const QueryState& q);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const MNotifyRec& infoevt);
void exit();
};
typedef boost::mpl::list <
boost::statechart::custom_reaction< AdvMap >,
boost::statechart::custom_reaction< MNotifyRec >,
+ boost::statechart::custom_reaction< QueryUnfound >,
boost::statechart::custom_reaction< QueryState >
> reactions;
explicit Incomplete(my_context ctx);
boost::statechart::result react(const AdvMap &advmap);
boost::statechart::result react(const MNotifyRec& infoevt);
+ boost::statechart::result react(const QueryUnfound& q);
boost::statechart::result react(const QueryState& q);
void exit();
};
}
void update_heartbeat_peers();
+ void query_unfound(Formatter *f, string state);
bool proc_replica_info(
pg_shard_t from, const pg_info_t &oinfo, epoch_t send_epoch);
void remove_down_peer_info(const OSDMapRef &osdmap);