summaryrefslogtreecommitdiffstats
path: root/src/messages/MOSDPGReadyToMerge.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/messages/MOSDPGReadyToMerge.h')
-rw-r--r--src/messages/MOSDPGReadyToMerge.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/messages/MOSDPGReadyToMerge.h b/src/messages/MOSDPGReadyToMerge.h
new file mode 100644
index 000000000..e75212638
--- /dev/null
+++ b/src/messages/MOSDPGReadyToMerge.h
@@ -0,0 +1,61 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#pragma once
+
+class MOSDPGReadyToMerge : public PaxosServiceMessage {
+public:
+ pg_t pgid;
+ eversion_t source_version, target_version;
+ epoch_t last_epoch_started = 0;
+ epoch_t last_epoch_clean = 0;
+ bool ready = true;
+
+ MOSDPGReadyToMerge()
+ : PaxosServiceMessage{MSG_OSD_PG_READY_TO_MERGE, 0}
+ {}
+ MOSDPGReadyToMerge(pg_t p, eversion_t sv, eversion_t tv,
+ epoch_t les, epoch_t lec, bool r, epoch_t v)
+ : PaxosServiceMessage{MSG_OSD_PG_READY_TO_MERGE, v},
+ pgid(p),
+ source_version(sv),
+ target_version(tv),
+ last_epoch_started(les),
+ last_epoch_clean(lec),
+ ready(r)
+ {}
+ void encode_payload(uint64_t features) override {
+ using ceph::encode;
+ paxos_encode();
+ encode(pgid, payload);
+ encode(source_version, payload);
+ encode(target_version, payload);
+ encode(last_epoch_started, payload);
+ encode(last_epoch_clean, payload);
+ encode(ready, payload);
+ }
+ void decode_payload() override {
+ using ceph::decode;
+ auto p = payload.cbegin();
+ paxos_decode(p);
+ decode(pgid, p);
+ decode(source_version, p);
+ decode(target_version, p);
+ decode(last_epoch_started, p);
+ decode(last_epoch_clean, p);
+ decode(ready, p);
+ }
+ std::string_view get_type_name() const override { return "osd_pg_ready_to_merge"; }
+ void print(std::ostream &out) const {
+ out << get_type_name()
+ << "(" << pgid
+ << " sv " << source_version
+ << " tv " << target_version
+ << " les/c " << last_epoch_started << "/" << last_epoch_clean
+ << (ready ? " ready" : " NOT READY")
+ << " v" << version << ")";
+ }
+private:
+ template<class T, typename... Args>
+ friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
+};