From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/messages/PaxosServiceMessage.h | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/messages/PaxosServiceMessage.h (limited to 'src/messages/PaxosServiceMessage.h') diff --git a/src/messages/PaxosServiceMessage.h b/src/messages/PaxosServiceMessage.h new file mode 100644 index 00000000..5b0b1bf5 --- /dev/null +++ b/src/messages/PaxosServiceMessage.h @@ -0,0 +1,56 @@ +#ifndef CEPH_PAXOSSERVICEMESSAGE_H +#define CEPH_PAXOSSERVICEMESSAGE_H + +#include "msg/Message.h" +#include "mon/Session.h" + +class PaxosServiceMessage : public MessageSubType { +public: + version_t version; + __s16 deprecated_session_mon; + uint64_t deprecated_session_mon_tid; + + // track which epoch the leader received a forwarded request in, so we can + // discard forwarded requests appropriately on election boundaries. + epoch_t rx_election_epoch; + + PaxosServiceMessage() + : MessageSubType(MSG_PAXOS), + version(0), deprecated_session_mon(-1), deprecated_session_mon_tid(0), + rx_election_epoch(0) { } + PaxosServiceMessage(int type, version_t v, int enc_version=1, int compat_enc_version=0) + : MessageSubType(type, enc_version, compat_enc_version), + version(v), deprecated_session_mon(-1), deprecated_session_mon_tid(0), + rx_election_epoch(0) { } + protected: + virtual ~PaxosServiceMessage() override {} + + public: + void paxos_encode() { + using ceph::encode; + encode(version, payload); + encode(deprecated_session_mon, payload); + encode(deprecated_session_mon_tid, payload); + } + + void paxos_decode(bufferlist::const_iterator& p ) { + decode(version, p); + decode(deprecated_session_mon, p); + decode(deprecated_session_mon_tid, p); + } + + void encode_payload(uint64_t features) override { + ceph_abort(); + paxos_encode(); + } + + void decode_payload() override { + ceph_abort(); + auto p = payload.cbegin(); + paxos_decode(p); + } + + std::string_view get_type_name() const override { return "PaxosServiceMessage"; } +}; + +#endif -- cgit v1.2.3