We will create these directly from peering Messages shortly.
Signed-off-by: Sage Weil <sage@redhat.com>
osd/OSDMapMapping.cc
common/histogram.cc
osd/osd_types.cc
+ osd/PGPeeringEvent.cc
osd/OpRequest.cc
common/blkdev.cc
common/common_init.cc
PGPeeringEventRef(
new PGPeeringEvent(
it->first.epoch_sent, it->first.query_epoch,
- PG::MNotifyRec(pg_shard_t(from, it->first.from), it->first,
+ MNotifyRec(pg_shard_t(from, it->first.from), it->first,
op->get_req()->get_connection()->get_features())))
);
}
PGPeeringEventRef(
new PGPeeringEvent(
m->get_epoch(), m->get_query_epoch(),
- PG::MLogRec(pg_shard_t(from, m->from), m)))
+ MLogRec(pg_shard_t(from, m->from), m)))
);
}
PGPeeringEventRef(
new PGPeeringEvent(
p->first.epoch_sent, p->first.query_epoch,
- PG::MInfoRec(
+ MInfoRec(
pg_shard_t(
from, p->first.from), p->first.info, p->first.epoch_sent)))
);
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RequestBackfillPrio(m->priority)));
+ RequestBackfillPrio(m->priority)));
} else if (m->type == MBackfillReserve::GRANT) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RemoteBackfillReserved()));
+ RemoteBackfillReserved()));
} else if (m->type == MBackfillReserve::REJECT) {
// NOTE: this is replica -> primary "i reject your request"
// and also primary -> replica "cancel my previously-granted request"
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RemoteReservationRejected()));
+ RemoteReservationRejected()));
} else if (m->type == MBackfillReserve::RELEASE) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RemoteReservationCanceled()));
+ RemoteReservationCanceled()));
} else if (m->type == MBackfillReserve::TOOFULL) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RemoteReservationRevokedTooFull()));
+ RemoteReservationRevokedTooFull()));
} else if (m->type == MBackfillReserve::REVOKE) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RemoteReservationRevoked()));
+ RemoteReservationRevoked()));
} else {
ceph_abort();
}
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RequestRecoveryPrio(m->priority)));
+ RequestRecoveryPrio(m->priority)));
} else if (m->type == MRecoveryReserve::GRANT) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RemoteRecoveryReserved()));
+ RemoteRecoveryReserved()));
} else if (m->type == MRecoveryReserve::RELEASE) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::RecoveryDone()));
+ RecoveryDone()));
} else if (m->type == MRecoveryReserve::REVOKE) {
evt = PGPeeringEventRef(
new PGPeeringEvent(
m->query_epoch,
m->query_epoch,
- PG::DeferRecovery(0.0)));
+ DeferRecovery(0.0)));
} else {
ceph_abort();
}
PGPeeringEventRef(
new PGPeeringEvent(
it->second.epoch_sent, it->second.epoch_sent,
- PG::MQuery(pg_shard_t(from, it->second.from),
+ MQuery(pg_shard_t(from, it->second.from),
it->second, it->second.epoch_sent))));
continue;
}
return *_dout << t->gen_prefix();
}
-MEMPOOL_DEFINE_OBJECT_FACTORY(PGPeeringEvent, pg_peering_evt, osd);
-
void PGStateHistory::enter(PG* pg, const utime_t entime, const char* state)
{
// Ignore trimming state machine for now
};
public:
- struct MInfoRec : boost::statechart::event< MInfoRec > {
- pg_shard_t from;
- pg_info_t info;
- epoch_t msg_epoch;
- MInfoRec(pg_shard_t from, const pg_info_t &info, epoch_t msg_epoch) :
- from(from), info(info), msg_epoch(msg_epoch) {}
- void print(std::ostream *out) const {
- *out << "MInfoRec from " << from << " info: " << info;
- }
- };
- struct MLogRec : boost::statechart::event< MLogRec > {
- pg_shard_t from;
- boost::intrusive_ptr<MOSDPGLog> msg;
- MLogRec(pg_shard_t from, MOSDPGLog *msg) :
- from(from), msg(msg) {}
- void print(std::ostream *out) const {
- *out << "MLogRec from " << from;
- }
- };
-
- struct MNotifyRec : boost::statechart::event< MNotifyRec > {
- pg_shard_t from;
- pg_notify_t notify;
- uint64_t features;
- MNotifyRec(pg_shard_t from, const pg_notify_t ¬ify, uint64_t f) :
- from(from), notify(notify), features(f) {}
- void print(std::ostream *out) const {
- *out << "MNotifyRec from " << from << " notify: " << notify
- << " features: 0x" << hex << features << dec;
- }
- };
- struct MQuery : boost::statechart::event< MQuery > {
- pg_shard_t from;
- pg_query_t query;
- epoch_t query_epoch;
- MQuery(pg_shard_t from, const pg_query_t &query, epoch_t query_epoch):
- from(from), query(query), query_epoch(query_epoch) {}
- void print(std::ostream *out) const {
- *out << "MQuery from " << from
- << " query_epoch " << query_epoch
- << " query: " << query;
- }
- };
protected:
struct AdvMap : boost::statechart::event< AdvMap > {
}
};
public:
- struct RequestBackfillPrio : boost::statechart::event< RequestBackfillPrio > {
- unsigned priority;
- explicit RequestBackfillPrio(unsigned prio) :
- boost::statechart::event< RequestBackfillPrio >(),
- priority(prio) {}
- void print(std::ostream *out) const {
- *out << "RequestBackfillPrio: priority " << priority;
- }
- };
- struct RequestRecoveryPrio : boost::statechart::event< RequestRecoveryPrio > {
- unsigned priority;
- explicit RequestRecoveryPrio(unsigned prio) :
- boost::statechart::event< RequestRecoveryPrio >(),
- priority(prio) {}
- void print(std::ostream *out) const {
- *out << "RequestRecoveryPrio: priority " << priority;
- }
- };
-#define TrivialEvent(T) struct T : boost::statechart::event< T > { \
- T() : boost::statechart::event< T >() {} \
- void print(std::ostream *out) const { \
- *out << #T; \
- } \
- };
- struct DeferBackfill : boost::statechart::event<DeferBackfill> {
- float delay;
- explicit DeferBackfill(float delay) : delay(delay) {}
- void print(std::ostream *out) const {
- *out << "DeferBackfill: delay " << delay;
- }
- };
- struct DeferRecovery : boost::statechart::event<DeferRecovery> {
- float delay;
- explicit DeferRecovery(float delay) : delay(delay) {}
- void print(std::ostream *out) const {
- *out << "DeferRecovery: delay " << delay;
- }
- };
struct UnfoundBackfill : boost::statechart::event<UnfoundBackfill> {
explicit UnfoundBackfill() {}
void print(std::ostream *out) const {
protected:
TrivialEvent(Backfilled)
TrivialEvent(LocalBackfillReserved)
- public:
- TrivialEvent(RemoteBackfillReserved)
- protected:
TrivialEvent(RejectRemoteReservation)
public:
- TrivialEvent(RemoteReservationRejected)
- TrivialEvent(RemoteReservationRevokedTooFull)
- TrivialEvent(RemoteReservationRevoked)
- TrivialEvent(RemoteReservationCanceled)
TrivialEvent(RequestBackfill)
- TrivialEvent(RecoveryDone)
protected:
TrivialEvent(RemoteRecoveryPreempted)
TrivialEvent(RemoteBackfillPreempted)
TrivialEvent(DoRecovery)
TrivialEvent(LocalRecoveryReserved)
public:
- TrivialEvent(RemoteRecoveryReserved)
protected:
TrivialEvent(AllRemotesReserved)
TrivialEvent(AllBackfillsReserved)
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#include "include/mempool.h"
+#include "osd/PGPeeringEvent.h"
+#include "messages/MOSDPGLog.h"
+
+MEMPOOL_DEFINE_OBJECT_FACTORY(PGPeeringEvent, pg_peering_evt, osd);
#include <boost/statechart/event.hpp>
+#include "osd/osd_types.h"
+
+class MOSDPGLog;
+
class PGPeeringEvent {
epoch_t epoch_sent;
epoch_t epoch_requested;
}
};
typedef ceph::shared_ptr<PGPeeringEvent> PGPeeringEventRef;
+
+struct MInfoRec : boost::statechart::event< MInfoRec > {
+ pg_shard_t from;
+ pg_info_t info;
+ epoch_t msg_epoch;
+ MInfoRec(pg_shard_t from, const pg_info_t &info, epoch_t msg_epoch) :
+ from(from), info(info), msg_epoch(msg_epoch) {}
+ void print(std::ostream *out) const {
+ *out << "MInfoRec from " << from << " info: " << info;
+ }
+};
+
+struct MLogRec : boost::statechart::event< MLogRec > {
+ pg_shard_t from;
+ boost::intrusive_ptr<MOSDPGLog> msg;
+ MLogRec(pg_shard_t from, MOSDPGLog *msg) :
+ from(from), msg(msg) {}
+ void print(std::ostream *out) const {
+ *out << "MLogRec from " << from;
+ }
+};
+
+struct MNotifyRec : boost::statechart::event< MNotifyRec > {
+ pg_shard_t from;
+ pg_notify_t notify;
+ uint64_t features;
+ MNotifyRec(pg_shard_t from, const pg_notify_t ¬ify, uint64_t f) :
+ from(from), notify(notify), features(f) {}
+ void print(std::ostream *out) const {
+ *out << "MNotifyRec from " << from << " notify: " << notify
+ << " features: 0x" << hex << features << dec;
+ }
+};
+
+struct MQuery : boost::statechart::event< MQuery > {
+ pg_shard_t from;
+ pg_query_t query;
+ epoch_t query_epoch;
+ MQuery(pg_shard_t from, const pg_query_t &query, epoch_t query_epoch):
+ from(from), query(query), query_epoch(query_epoch) {}
+ void print(std::ostream *out) const {
+ *out << "MQuery from " << from
+ << " query_epoch " << query_epoch
+ << " query: " << query;
+ }
+};
+
+struct RequestBackfillPrio : boost::statechart::event< RequestBackfillPrio > {
+ unsigned priority;
+ explicit RequestBackfillPrio(unsigned prio) :
+ boost::statechart::event< RequestBackfillPrio >(),
+ priority(prio) {}
+ void print(std::ostream *out) const {
+ *out << "RequestBackfillPrio: priority " << priority;
+ }
+};
+
+struct RequestRecoveryPrio : boost::statechart::event< RequestRecoveryPrio > {
+ unsigned priority;
+ explicit RequestRecoveryPrio(unsigned prio) :
+ boost::statechart::event< RequestRecoveryPrio >(),
+ priority(prio) {}
+ void print(std::ostream *out) const {
+ *out << "RequestRecoveryPrio: priority " << priority;
+ }
+};
+
+#define TrivialEvent(T) struct T : boost::statechart::event< T > { \
+ T() : boost::statechart::event< T >() {} \
+ void print(std::ostream *out) const { \
+ *out << #T; \
+ } \
+ };
+
+TrivialEvent(RemoteBackfillReserved)
+TrivialEvent(RemoteReservationRejected)
+TrivialEvent(RemoteReservationRevokedTooFull)
+TrivialEvent(RemoteReservationRevoked)
+TrivialEvent(RemoteReservationCanceled)
+TrivialEvent(RemoteRecoveryReserved)
+TrivialEvent(RecoveryDone)
+
+struct DeferRecovery : boost::statechart::event<DeferRecovery> {
+ float delay;
+ explicit DeferRecovery(float delay) : delay(delay) {}
+ void print(std::ostream *out) const {
+ *out << "DeferRecovery: delay " << delay;
+ }
+};
+
+struct DeferBackfill : boost::statechart::event<DeferBackfill> {
+ float delay;
+ explicit DeferBackfill(float delay) : delay(delay) {}
+ void print(std::ostream *out) const {
+ *out << "DeferBackfill: delay " << delay;
+ }
+};