]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mon/OSDMonitor.h
update sources to v12.1.0
[ceph.git] / ceph / src / mon / OSDMonitor.h
index 44f013f27f756c15221ffb47c2c570ca9a592900..3f258815a1242efc3bdc0b25cf286c60762c4512 100644 (file)
@@ -147,7 +147,7 @@ public:
 
   bool check_failures(utime_t now);
   bool check_failure(utime_t now, int target_osd, failure_info_t& fi);
-  void force_failure(utime_t now, int target_osd);
+  void force_failure(utime_t now, int target_osd, int by);
 
   // the time of last msg(MSG_ALIVE and MSG_PGTEMP) proposed without delay
   utime_t last_attempted_minwait_time;
@@ -316,20 +316,20 @@ private:
                        ErasureCodeProfile &profile,
                        bool force,
                        ostream *ss);
-  int crush_ruleset_create_erasure(const string &name,
-                                  const string &profile,
-                                  int *ruleset,
-                                  ostream *ss);
-  int get_crush_ruleset(const string &ruleset_name,
-                       int *crush_ruleset,
+  int crush_rule_create_erasure(const string &name,
+                               const string &profile,
+                               int *rule,
+                               ostream *ss);
+  int get_crush_rule(const string &rule_name,
+                       int *crush_rule,
                        ostream *ss);
   int get_erasure_code(const string &erasure_code_profile,
                       ErasureCodeInterfaceRef *erasure_code,
                       ostream *ss) const;
-  int prepare_pool_crush_ruleset(const unsigned pool_type,
+  int prepare_pool_crush_rule(const unsigned pool_type,
                                 const string &erasure_code_profile,
-                                const string &ruleset_name,
-                                int *crush_ruleset,
+                                const string &rule_name,
+                                int *crush_rule,
                                 ostream *ss);
   bool erasure_code_profile_in_use(
     const mempool::osdmap::map<int64_t, pg_pool_t> &pools,
@@ -347,8 +347,8 @@ private:
                                unsigned *stripe_width,
                                ostream *ss);
   int prepare_new_pool(string& name, uint64_t auid,
-                      int crush_ruleset,
-                      const string &crush_ruleset_name,
+                      int crush_rule,
+                      const string &crush_rule_name,
                        unsigned pg_num, unsigned pgp_num,
                       const string &erasure_code_profile,
                        const unsigned pool_type,
@@ -429,6 +429,7 @@ private:
   OpTracker op_tracker;
 
   int load_metadata(int osd, map<string, string>& m, ostream *err);
+  void count_metadata(const string& field, Formatter *f);
   int get_osd_objectstore_type(int osd, std::string *type);
   bool is_pool_currently_all_bluestore(int64_t pool_id, const pg_pool_t &pool,
                                       ostream *err);
@@ -452,8 +453,9 @@ private:
   std::mutex creating_pgs_lock;
 
   creating_pgs_t update_pending_pgs(const OSDMap::Incremental& inc);
-  void trim_creating_pgs(creating_pgs_t *creating_pgs, const PGMap& pgm);
-  void scan_for_creating_pgs(
+  void trim_creating_pgs(creating_pgs_t *creating_pgs,
+                        const ceph::unordered_map<pg_t,pg_stat_t>& pgm);
+  unsigned scan_for_creating_pgs(
     const mempool::osdmap::map<int64_t,pg_pool_t>& pools,
     const mempool::osdmap::set<int64_t>& removed_pools,
     utime_t modified,
@@ -463,13 +465,13 @@ private:
   void check_pg_creates_subs();
   epoch_t send_pg_creates(int osd, Connection *con, epoch_t next);
 
+  int32_t _allocate_osd_id(int32_t* existing_id);
+
 public:
   OSDMonitor(CephContext *cct, Monitor *mn, Paxos *p, const string& service_name);
 
   void tick() override;  // check state, take actions
 
-  int parse_osd_id(const char *s, stringstream *pss);
-
   void get_health(list<pair<health_status_t,string> >& summary,
                  list<pair<health_status_t,string> > *detail,
                  CephContext *cct) const override;
@@ -477,6 +479,41 @@ public:
   bool prepare_command(MonOpRequestRef op);
   bool prepare_command_impl(MonOpRequestRef op, map<string,cmd_vartype>& cmdmap);
 
+  int validate_osd_create(
+      const int32_t id,
+      const uuid_d& uuid,
+      const bool check_osd_exists,
+      int32_t* existing_id,
+      stringstream& ss);
+  int prepare_command_osd_create(
+      const int32_t id,
+      const uuid_d& uuid,
+      int32_t* existing_id,
+      stringstream& ss);
+  void do_osd_create(const int32_t id, const uuid_d& uuid, int32_t* new_id);
+  int prepare_command_osd_purge(int32_t id, stringstream& ss);
+  int prepare_command_osd_destroy(int32_t id, stringstream& ss);
+  int _prepare_command_osd_crush_remove(
+      CrushWrapper &newcrush,
+      int32_t id,
+      int32_t ancestor,
+      bool has_ancestor,
+      bool unlink_only);
+  void do_osd_crush_remove(CrushWrapper& newcrush);
+  int prepare_command_osd_crush_remove(
+      CrushWrapper &newcrush,
+      int32_t id,
+      int32_t ancestor,
+      bool has_ancestor,
+      bool unlink_only);
+  int prepare_command_osd_remove(int32_t id);
+  int prepare_command_osd_new(
+      MonOpRequestRef op,
+      const map<string,cmd_vartype>& cmdmap,
+      const map<string,string>& secrets,
+      stringstream &ss,
+      Formatter *f);
+
   int prepare_command_pool_set(map<string,cmd_vartype> &cmdmap,
                                stringstream& ss);