1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_MOSDPGRECOVERYDELETE_H
5 #define CEPH_MOSDPGRECOVERYDELETE_H
7 #include "MOSDFastDispatchOp.h"
10 * instruct non-primary to remove some objects during recovery
13 class MOSDPGRecoveryDelete final
: public MOSDFastDispatchOp
{
15 static constexpr int HEAD_VERSION
= 2;
16 static constexpr int COMPAT_VERSION
= 1;
19 spg_t pgid
; ///< target spg_t
20 epoch_t map_epoch
, min_epoch
;
21 std::list
<std::pair
<hobject_t
, eversion_t
>> objects
; ///< objects to remove
27 int get_cost() const override
{
31 epoch_t
get_map_epoch() const override
{
34 epoch_t
get_min_epoch() const override
{
37 spg_t
get_spg() const override
{
41 void set_cost(uint64_t c
) {
45 MOSDPGRecoveryDelete()
46 : MOSDFastDispatchOp
{MSG_OSD_PG_RECOVERY_DELETE
, HEAD_VERSION
,
50 MOSDPGRecoveryDelete(pg_shard_t from
, spg_t pgid
, epoch_t map_epoch
,
52 : MOSDFastDispatchOp
{MSG_OSD_PG_RECOVERY_DELETE
, HEAD_VERSION
,
61 ~MOSDPGRecoveryDelete() final
{}
64 std::string_view
get_type_name() const { return "recovery_delete"; }
65 void print(std::ostream
& out
) const {
66 out
<< "MOSDPGRecoveryDelete(" << pgid
<< " e" << map_epoch
<< ","
67 << min_epoch
<< " " << objects
<< ")";
70 void encode_payload(uint64_t features
) {
72 encode(from
, payload
);
73 encode(pgid
, payload
);
74 encode(map_epoch
, payload
);
75 encode(min_epoch
, payload
);
76 encode(cost
, payload
);
77 encode(objects
, payload
);
79 void decode_payload() {
81 auto p
= payload
.cbegin();
90 template<class T
, typename
... Args
>
91 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);