]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mon/MDSMonitor.h
update sources to 12.2.7
[ceph.git] / ceph / src / mon / MDSMonitor.h
index 3d84f92a811fc6ec393fd348773942e7d2168f9c..88e9decf266ca25b9672f517a680f3a23e249620 100644 (file)
@@ -23,8 +23,7 @@
 using namespace std;
 
 #include "include/types.h"
-#include "mds/FSMap.h"
-#include "mds/MDSMap.h"
+#include "PaxosFSMap.h"
 #include "PaxosService.h"
 #include "msg/Messenger.h"
 #include "messages/MMDSBeacon.h"
@@ -34,7 +33,7 @@ class MMDSLoadTargets;
 class MMDSMap;
 class FileSystemCommandHandler;
 
-class MDSMonitor : public PaxosService {
+class MDSMonitor : public PaxosService, public PaxosFSMap {
  public:
   MDSMonitor(Monitor *mn, Paxos *p, string service_name);
 
@@ -59,8 +58,6 @@ class MDSMonitor : public PaxosService {
   void check_subs();
   void check_sub(Subscription *sub);
 
-  const FSMap &get_pending() const { return pending_fsmap; }
-  const FSMap &get_fsmap() const { return fsmap; }
   void dump_info(Formatter *f);
   int print_nodes(Formatter *f);
 
@@ -68,13 +65,12 @@ class MDSMonitor : public PaxosService {
    * Return true if a blacklist was done (i.e. OSD propose needed)
    */
   bool fail_mds_gid(mds_gid_t gid);
- protected:
-  // mds maps
-  FSMap fsmap;           // current
-  FSMap pending_fsmap;  // current + pending updates
 
+  bool is_leader() const override { return mon->is_leader(); }
+
+ protected:
   // my helpers
-  void print_map(FSMap &m, int dbl=7);
+  void print_map(const FSMap &m, int dbl=7);
   void update_logger();
 
   void _updated(MonOpRequestRef op);
@@ -127,8 +123,8 @@ class MDSMonitor : public PaxosService {
 
   std::list<std::shared_ptr<FileSystemCommandHandler> > handlers;
 
-  bool maybe_promote_standby(std::shared_ptr<Filesystem> fs);
-  bool maybe_expand_cluster(std::shared_ptr<Filesystem> fs);
+  bool maybe_promote_standby(std::shared_ptr<Filesystem> &fs);
+  bool maybe_expand_cluster(std::shared_ptr<Filesystem> &fs);
   void maybe_replace_gid(mds_gid_t gid, const MDSMap::mds_info_t& info,
       bool *mds_propose, bool *osd_propose);
   void tick() override;     // check state, take actions