1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
16 #ifndef CEPH_MOSDPGUPDATELOGMISSINGREPLY_H
17 #define CEPH_MOSDPGUPDATELOGMISSINGREPLY_H
19 #include "MOSDFastDispatchOp.h"
21 class MOSDPGUpdateLogMissingReply final
: public MOSDFastDispatchOp
{
23 static constexpr int HEAD_VERSION
= 3;
24 static constexpr int COMPAT_VERSION
= 1;
28 epoch_t map_epoch
= 0, min_epoch
= 0;
31 ceph_tid_t rep_tid
= 0;
32 // piggybacked osd state
33 eversion_t last_complete_ondisk
;
35 epoch_t
get_epoch() const { return map_epoch
; }
36 spg_t
get_pgid() const { return pgid
; }
37 epoch_t
get_query_epoch() const { return map_epoch
; }
38 ceph_tid_t
get_tid() const { return rep_tid
; }
39 pg_shard_t
get_from() const {
40 return pg_shard_t(get_source().num(), from
);
42 epoch_t
get_map_epoch() const override
{
45 epoch_t
get_min_epoch() const override
{
48 spg_t
get_spg() const override
{
52 MOSDPGUpdateLogMissingReply()
53 : MOSDFastDispatchOp
{MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY
, HEAD_VERSION
,
56 MOSDPGUpdateLogMissingReply(
62 eversion_t last_complete_ondisk
)
63 : MOSDFastDispatchOp
{MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY
, HEAD_VERSION
,
70 last_complete_ondisk(last_complete_ondisk
)
74 ~MOSDPGUpdateLogMissingReply() final
{}
77 std::string_view
get_type_name() const override
{ return "PGUpdateLogMissingReply"; }
78 void print(std::ostream
& out
) const override
{
79 out
<< "pg_update_log_missing_reply(" << pgid
<< " epoch " << map_epoch
81 << " rep_tid " << rep_tid
82 << " lcod " << last_complete_ondisk
<< ")";
85 void encode_payload(uint64_t features
) override
{
87 encode(map_epoch
, payload
);
88 encode(pgid
, payload
);
89 encode(from
, payload
);
90 encode(rep_tid
, payload
);
91 encode(min_epoch
, payload
);
92 encode(last_complete_ondisk
, payload
);
94 void decode_payload() override
{
96 auto p
= payload
.cbegin();
101 if (header
.version
>= 2) {
102 decode(min_epoch
, p
);
104 min_epoch
= map_epoch
;
106 if (header
.version
>= 3) {
107 decode(last_complete_ondisk
, p
);
111 template<class T
, typename
... Args
>
112 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);