#define CEPH_MSG_OSD_OP 42
#define CEPH_MSG_OSD_OPREPLY 43
#define CEPH_MSG_WATCH_NOTIFY 44
+#define CEPH_MSG_OSD_BACKOFF 61
/* FSMap subscribers (see all MDS clusters at once) */
#define CEPH_MSG_FS_MAP 45
/* FSMapUser subscribers (get MDS clusters name->ID mapping) */
#define CEPH_MSG_FS_MAP_USER 103
-
/* watch-notify operations */
enum {
CEPH_WATCH_EVENT_NOTIFY = 1, /* notifying watcher */
const char *ceph_osd_alloc_hint_flag_name(int f);
+enum {
+ CEPH_OSD_BACKOFF_OP_BLOCK = 1,
+ CEPH_OSD_BACKOFF_OP_ACK_BLOCK = 2,
+ CEPH_OSD_BACKOFF_OP_UNBLOCK = 3,
+};
+
+const char *ceph_osd_backoff_op_name(int op);
+
/*
* an individual object operation. each may be accompanied by some data
* payload
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2017 Red Hat
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation. See file COPYING.
+ *
+ */
+
+
+#ifndef CEPH_MOSDBACKOFF_H
+#define CEPH_MOSDBACKOFF_H
+
+#include "msg/Message.h"
+#include "osd/osd_types.h"
+
+class MOSDBackoff : public Message {
+public:
+ uint8_t op = 0; ///< CEPH_OSD_BACKOFF_OP_*
+ uint64_t id = 0; ///< unique id within this session
+ hobject_t begin, end; ///< [) range to block, unless ==, block single obj
+ epoch_t osd_epoch = 0;
+
+ MOSDBackoff() : Message(CEPH_MSG_OSD_BACKOFF) {}
+ MOSDBackoff(uint8_t op_, uint64_t id_,
+ hobject_t begin_, hobject_t end_, epoch_t ep)
+ : Message(CEPH_MSG_OSD_BACKOFF),
+ op(op_),
+ id(id_),
+ begin(begin_),
+ end(end_),
+ osd_epoch(ep) { }
+
+ void encode_payload(uint64_t features) override {
+ ::encode(op, payload);
+ ::encode(id, payload);
+ ::encode(begin, payload);
+ ::encode(end, payload);
+ ::encode(osd_epoch, payload);
+ }
+
+ void decode_payload() override {
+ auto p = payload.begin();
+ ::decode(op, p);
+ ::decode(id, p);
+ ::decode(begin, p);
+ ::decode(end, p);
+ ::decode(osd_epoch, p);
+ }
+
+ const char *get_type_name() const override { return "osd_backoff"; }
+
+ void print(ostream& out) const override {
+ out << "osd_backoff(" << ceph_osd_backoff_op_name(op)
+ << " id " << id
+ << " [" << begin << "," << end << ")"
+ << " epoch " << osd_epoch << ")";
+ }
+};
+
+#endif
#include "messages/MOSDRepScrub.h"
#include "messages/MOSDPGScan.h"
#include "messages/MOSDPGBackfill.h"
+#include "messages/MOSDBackoff.h"
#include "messages/MRemoveSnaps.h"
case MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY:
m = new MOSDPGUpdateLogMissingReply();
break;
+ case CEPH_MSG_OSD_BACKOFF:
+ m = new MOSDBackoff;
+ break;
case CEPH_MSG_OSD_MAP:
m = new MOSDMap;