#include "messages/MOSDBeacon.h"
#include "messages/MOSDBoot.h"
#include "messages/MOSDMap.h"
+#include "messages/MOSDOp.h"
#include "messages/MOSDPGInfo.h"
#include "messages/MOSDPGLog.h"
#include "messages/MOSDPGNotify.h"
switch (m->get_type()) {
case CEPH_MSG_OSD_MAP:
return handle_osd_map(conn, boost::static_pointer_cast<MOSDMap>(m));
+ case CEPH_MSG_OSD_OP:
+ return handle_osd_op(conn, boost::static_pointer_cast<MOSDOp>(m));
case MSG_OSD_PG_NOTIFY:
return handle_pg_notify(conn, boost::static_pointer_cast<MOSDPGNotify>(m));
case MSG_OSD_PG_INFO:
});
}
+seastar::future<> OSD::handle_osd_op(ceph::net::ConnectionRef conn,
+ Ref<MOSDOp> m)
+{
+ return wait_for_map(m->get_map_epoch()).then([=](epoch_t epoch) {
+ if (auto found = pgs.find(m->get_spg()); found != pgs.end()) {
+ return found->second->handle_op(conn, std::move(m));
+ } else if (osdmap->is_up_acting_osd_shard(m->get_spg(), whoami)) {
+ logger().info("no pg, should exist e{}, will wait", epoch);
+ // todo, wait for peering, etc
+ return seastar::now();
+ } else {
+ logger().info("no pg, shouldn't exist e{}, dropping", epoch);
+ // todo: share map with client
+ return seastar::now();
+ }
+ });
+}
+
bool OSD::should_restart() const
{
if (!osdmap->is_up(whoami)) {
#include "osd/osd_types.h"
class MOSDMap;
+class MOSDOp;
class OSDMap;
class OSDMeta;
class PG;
seastar::future<> handle_osd_map(ceph::net::ConnectionRef conn,
Ref<MOSDMap> m);
+ seastar::future<> handle_osd_op(ceph::net::ConnectionRef conn,
+ Ref<MOSDOp> m);
seastar::future<> handle_pg_log(ceph::net::ConnectionRef conn,
Ref<MOSDPGLog> m);
seastar::future<> handle_pg_notify(ceph::net::ConnectionRef conn,
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <seastar/core/future.hh>
+#include "crimson/net/Fwd.h"
#include "osd/osd_types.h"
#include "recovery_state.h"
seastar::future<> handle_activate_map();
seastar::future<> share_pg_info();
void reply_pg_query(const MQuery& query, recovery::Context* ctx);
-
+ seastar::future<> handle_op(ceph::net::ConnectionRef conn,
+ Ref<MOSDOp> m);
void print(ostream& os) const;
-
private:
seastar::future<> activate_peer(pg_shard_t peer);
void reply_pg_query_for_info(const MQuery& query, recovery::Context* ctx);