--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include "messages/MOSDPeeringOp.h"
+#include "osd/PGPeeringEvent.h"
+
+class MOSDPGInfo2 : public MOSDPeeringOp {
+private:
+ static constexpr int HEAD_VERSION = 1;
+ static constexpr int COMPAT_VERSION = 1;
+
+public:
+ spg_t spgid;
+ epoch_t epoch_sent;
+ epoch_t min_epoch;
+ pg_info_t info;
+
+ spg_t get_spg() const override {
+ return spgid;
+ }
+ epoch_t get_map_epoch() const override {
+ return epoch_sent;
+ }
+ epoch_t get_min_epoch() const override {
+ return min_epoch;
+ }
+
+ PGPeeringEvent *get_event() override {
+ return new PGPeeringEvent(
+ epoch_sent,
+ min_epoch,
+ MInfoRec(
+ pg_shard_t(get_source().num(), info.pgid.shard),
+ info,
+ epoch_sent));
+ }
+
+ MOSDPGInfo2() : MOSDPeeringOp{MSG_OSD_PG_INFO2,
+ HEAD_VERSION, COMPAT_VERSION} {
+ set_priority(CEPH_MSG_PRIO_HIGH);
+ }
+ MOSDPGInfo2(
+ spg_t s,
+ pg_info_t q,
+ epoch_t sent,
+ epoch_t min)
+ : MOSDPeeringOp{MSG_OSD_PG_INFO2, HEAD_VERSION, COMPAT_VERSION},
+ spgid(s),
+ epoch_sent(sent),
+ min_epoch(min),
+ info(q) {
+ set_priority(CEPH_MSG_PRIO_HIGH);
+ }
+
+private:
+ ~MOSDPGInfo2() override {}
+
+public:
+ std::string_view get_type_name() const override {
+ return "pg_info2";
+ }
+ void inner_print(std::ostream& out) const override {
+ out << spgid << " " << info;
+ }
+
+ void encode_payload(uint64_t features) override {
+ using ceph::encode;
+ encode(spgid, payload);
+ encode(epoch_sent, payload);
+ encode(min_epoch, payload);
+ encode(info, payload);
+ }
+ void decode_payload() override {
+ using ceph::decode;
+ auto p = payload.cbegin();
+ decode(spgid, p);
+ decode(epoch_sent, p);
+ decode(min_epoch, p);
+ decode(info, p);
+ }
+private:
+ template<class T, typename... Args>
+ friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
+};
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include "messages/MOSDPeeringOp.h"
+#include "osd/PGPeeringEvent.h"
+
+class MOSDPGNotify2 : public MOSDPeeringOp {
+private:
+ static constexpr int HEAD_VERSION = 1;
+ static constexpr int COMPAT_VERSION = 1;
+
+public:
+ spg_t spgid;
+ pg_notify_t notify;
+
+ spg_t get_spg() const override {
+ return spgid;
+ }
+ epoch_t get_map_epoch() const override {
+ return notify.epoch_sent;
+ }
+ epoch_t get_min_epoch() const override {
+ return notify.query_epoch;
+ }
+
+ PGPeeringEvent *get_event() override {
+ return new PGPeeringEvent(
+ notify.epoch_sent,
+ notify.query_epoch,
+ MNotifyRec(
+ spgid,
+ pg_shard_t(get_source().num(), notify.from),
+ notify,
+ get_connection()->get_features()),
+ true,
+ new PGCreateInfo(
+ spgid,
+ notify.epoch_sent,
+ notify.info.history,
+ notify.past_intervals,
+ false));
+ }
+
+ MOSDPGNotify2() : MOSDPeeringOp{MSG_OSD_PG_NOTIFY2,
+ HEAD_VERSION, COMPAT_VERSION} {
+ set_priority(CEPH_MSG_PRIO_HIGH);
+ }
+ MOSDPGNotify2(
+ spg_t s,
+ pg_notify_t n)
+ : MOSDPeeringOp{MSG_OSD_PG_NOTIFY2, HEAD_VERSION, COMPAT_VERSION},
+ spgid(s),
+ notify(n) {
+ set_priority(CEPH_MSG_PRIO_HIGH);
+ }
+
+private:
+ ~MOSDPGNotify2() override {}
+
+public:
+ std::string_view get_type_name() const override {
+ return "pg_notify2";
+ }
+ void inner_print(std::ostream& out) const override {
+ out << spgid << " " << notify;
+ }
+
+ void encode_payload(uint64_t features) override {
+ using ceph::encode;
+ encode(spgid, payload);
+ encode(notify, payload);
+ }
+ void decode_payload() override {
+ using ceph::decode;
+ auto p = payload.cbegin();
+ decode(spgid, p);
+ decode(notify, p);
+ }
+private:
+ template<class T, typename... Args>
+ friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
+};
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+#include "messages/MOSDPeeringOp.h"
+#include "osd/PGPeeringEvent.h"
+
+class MOSDPGQuery2 : public MOSDPeeringOp {
+private:
+ static constexpr int HEAD_VERSION = 1;
+ static constexpr int COMPAT_VERSION = 1;
+
+public:
+ spg_t spgid;
+ pg_query_t query;
+
+ spg_t get_spg() const override {
+ return spgid;
+ }
+ epoch_t get_map_epoch() const override {
+ return query.epoch_sent;
+ }
+ epoch_t get_min_epoch() const override {
+ return query.epoch_sent;
+ }
+
+ PGPeeringEvent *get_event() override {
+ return new PGPeeringEvent(
+ query.epoch_sent,
+ query.epoch_sent,
+ MQuery(
+ spgid,
+ pg_shard_t(get_source().num(), query.from),
+ query,
+ query.epoch_sent),
+ false);
+ }
+
+ MOSDPGQuery2() : MOSDPeeringOp{MSG_OSD_PG_QUERY2,
+ HEAD_VERSION, COMPAT_VERSION} {
+ set_priority(CEPH_MSG_PRIO_HIGH);
+ }
+ MOSDPGQuery2(
+ spg_t s,
+ pg_query_t q)
+ : MOSDPeeringOp{MSG_OSD_PG_QUERY2, HEAD_VERSION, COMPAT_VERSION},
+ spgid(s),
+ query(q) {
+ set_priority(CEPH_MSG_PRIO_HIGH);
+ }
+
+private:
+ ~MOSDPGQuery2() override {}
+
+public:
+ std::string_view get_type_name() const override {
+ return "pg_query2";
+ }
+ void inner_print(std::ostream& out) const override {
+ out << spgid << " " << query;
+ }
+
+ void encode_payload(uint64_t features) override {
+ using ceph::encode;
+ encode(spgid, payload);
+ encode(query, payload, features);
+ }
+ void decode_payload() override {
+ using ceph::decode;
+ auto p = payload.cbegin();
+ decode(spgid, p);
+ decode(query, p);
+ }
+private:
+ template<class T, typename... Args>
+ friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
+};
#include "messages/MOSDPGCreated.h"
#include "messages/MOSDPGNotify.h"
+#include "messages/MOSDPGNotify2.h"
#include "messages/MOSDPGQuery.h"
+#include "messages/MOSDPGQuery2.h"
#include "messages/MOSDPGLog.h"
#include "messages/MOSDPGRemove.h"
#include "messages/MOSDPGInfo.h"
+#include "messages/MOSDPGInfo2.h"
#include "messages/MOSDPGCreate.h"
#include "messages/MOSDPGCreate2.h"
#include "messages/MOSDPGTrim.h"
case MSG_OSD_PG_NOTIFY:
m = make_message<MOSDPGNotify>();
break;
+ case MSG_OSD_PG_NOTIFY2:
+ m = make_message<MOSDPGNotify2>();
+ break;
case MSG_OSD_PG_QUERY:
m = make_message<MOSDPGQuery>();
break;
+ case MSG_OSD_PG_QUERY2:
+ m = make_message<MOSDPGQuery2>();
+ break;
case MSG_OSD_PG_LOG:
m = make_message<MOSDPGLog>();
break;
case MSG_OSD_PG_INFO:
m = make_message<MOSDPGInfo>();
break;
+ case MSG_OSD_PG_INFO2:
+ m = make_message<MOSDPGInfo2>();
+ break;
case MSG_OSD_PG_CREATE:
m = make_message<MOSDPGCreate>();
break;
#define MSG_OSD_BEACON 79
#define MSG_OSD_PG_NOTIFY 80
+#define MSG_OSD_PG_NOTIFY2 130
#define MSG_OSD_PG_QUERY 81
+#define MSG_OSD_PG_QUERY2 131
#define MSG_OSD_PG_LOG 83
#define MSG_OSD_PG_REMOVE 84
#define MSG_OSD_PG_INFO 85
+#define MSG_OSD_PG_INFO2 132
#define MSG_OSD_PG_TRIM 86
#define MSG_PGSTATS 87
#include "messages/MOSDMap.h"
#include "messages/MMonGetOSDMap.h"
#include "messages/MOSDPGNotify.h"
+#include "messages/MOSDPGNotify2.h"
#include "messages/MOSDPGQuery.h"
+#include "messages/MOSDPGQuery2.h"
#include "messages/MOSDPGLog.h"
#include "messages/MOSDPGRemove.h"
#include "messages/MOSDPGInfo.h"
+#include "messages/MOSDPGInfo2.h"
#include "messages/MOSDPGCreate.h"
#include "messages/MOSDPGCreate2.h"
#include "messages/MOSDPGTrim.h"
// these are single-pg messages that handle themselves
case MSG_OSD_PG_LOG:
case MSG_OSD_PG_TRIM:
+ case MSG_OSD_PG_NOTIFY2:
+ case MSG_OSD_PG_QUERY2:
+ case MSG_OSD_PG_INFO2:
case MSG_OSD_BACKFILL_RESERVE:
case MSG_OSD_RECOVERY_RESERVE:
{
case MSG_MON_COMMAND:
case MSG_OSD_PG_CREATE2:
case MSG_OSD_PG_QUERY:
+ case MSG_OSD_PG_QUERY2:
case MSG_OSD_PG_INFO:
+ case MSG_OSD_PG_INFO2:
case MSG_OSD_PG_NOTIFY:
+ case MSG_OSD_PG_NOTIFY2:
case MSG_OSD_PG_LOG:
case MSG_OSD_PG_TRIM:
case MSG_OSD_PG_REMOVE: