This lets us distinguish between REJECT and CANCEL for clarity.
Signed-off-by: Sage Weil <sage@redhat.com>
#include "msg/Message.h"
class MBackfillReserve : public Message {
- static const int HEAD_VERSION = 3;
- static const int COMPAT_VERSION = 3;
+ static const int HEAD_VERSION = 4;
+ static const int COMPAT_VERSION = 4;
public:
spg_t pgid;
epoch_t query_epoch;
REQUEST = 0,
GRANT = 1,
REJECT = 2,
+ CANCEL = 3,
};
uint32_t type;
uint32_t priority;
case REJECT:
out << "REJECT ";
break;
+ case CANCEL:
+ out << "CANCEL ";
+ break;
}
out << " pgid: " << pgid << ", query_epoch: " << query_epoch;
if (type == REQUEST) out << ", prio: " << priority;
}
void encode_payload(uint64_t features) override {
+ if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
+ header.version = 3;
+ header.compat_version = 3;
+ ::encode(pgid.pgid, payload);
+ ::encode(query_epoch, payload);
+ ::encode(type == CANCEL ? REJECT : type, payload);
+ ::encode(priority, payload);
+ ::encode(pgid.shard, payload);
+ return;
+ }
+ header.version = HEAD_VERSION;
+ header.compat_version = COMPAT_VERSION;
::encode(pgid.pgid, payload);
::encode(query_epoch, payload);
::encode(type, payload);
} else if (m->type == MBackfillReserve::REJECT) {
// NOTE: this is replica -> primary "i reject your request"
// and also primary -> replica "cancel my previously-granted request"
+ // (for older peers)
evt = PG::CephPeeringEvtRef(
new PG::CephPeeringEvt(
m->query_epoch,
m->query_epoch,
PG::RemoteReservationRejected()));
+ } else if (m->type == MBackfillReserve::CANCEL) {
+ evt = PG::CephPeeringEvtRef(
+ new PG::CephPeeringEvt(
+ m->query_epoch,
+ m->query_epoch,
+ PG::RemoteReservationCanceled()));
} else {
ceph_abort();
}
if (con) {
pg->osd->send_message_osd_cluster(
new MBackfillReserve(
- MBackfillReserve::REJECT,
+ MBackfillReserve::CANCEL,
spg_t(pg->info.pgid.pgid, it->shard),
pg->get_osdmap()->get_epoch()),
con.get());
if (con) {
pg->osd->send_message_osd_cluster(
new MBackfillReserve(
- MBackfillReserve::REJECT,
+ MBackfillReserve::CANCEL,
spg_t(pg->info.pgid.pgid, it->shard),
pg->get_osdmap()->get_epoch()),
con.get());
PG *pg = context< RecoveryMachine >().pg;
pg->osd->local_reserver.cancel_reservation(pg->info.pgid);
- // Send REJECT to all previously acquired reservations
+ // Send CANCEL to all previously acquired reservations
set<pg_shard_t>::const_iterator it, begin, end, next;
begin = context< Active >().remote_shards_to_reserve_backfill.begin();
end = context< Active >().remote_shards_to_reserve_backfill.end();
if (con) {
pg->osd->send_message_osd_cluster(
new MBackfillReserve(
- MBackfillReserve::REJECT,
+ MBackfillReserve::CANCEL,
spg_t(pg->info.pgid.pgid, it->shard),
pg->get_osdmap()->get_epoch()),
con.get());