]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Monitor: define paxos_service with fixed array size 37315/head
authorChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 13 Oct 2020 01:29:51 +0000 (09:29 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Tue, 13 Oct 2020 01:29:51 +0000 (09:29 +0800)
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index 08e0cbf7d095cfdf7dc382287837307b60ea60ae..b80b5f5ade0042b4a88706746c46c7d84d43d172 100644 (file)
@@ -203,7 +203,6 @@ Monitor::Monitor(CephContext* cct_, string nm, MonitorDBStore *s,
   timecheck_rounds_since_clean(0),
   timecheck_event(NULL),
 
-  paxos_service(PAXOS_NUM),
   admin_hook(NULL),
   routed_request_tid(0),
   op_tracker(cct, g_conf().get_val<bool>("mon_enable_op_tracker"), 1)
@@ -286,7 +285,6 @@ Monitor::~Monitor()
 {
   op_tracker.on_shutdown();
 
-  paxos_service.clear();
   delete config_key_service;
   delete paxos;
   ceph_assert(session_map.sessions.empty());
index b6f6e517dfeeaac06de92e1ef5921db88a520845..5b4468f081318eed9ab7b46aec900bd29d09cbd8 100644 (file)
@@ -26,6 +26,7 @@
 #include <errno.h>
 #include <cmath>
 #include <string>
+#include <array>
 
 #include "include/types.h"
 #include "include/health.h"
@@ -637,7 +638,7 @@ public:
   /**
    * Vector holding the Services serviced by this Monitor.
    */
-  std::vector<std::unique_ptr<PaxosService>> paxos_service;
+  std::array<std::unique_ptr<PaxosService>, PAXOS_NUM> paxos_service;
 
   class MDSMonitor *mdsmon() {
     return (class MDSMonitor *)paxos_service[PAXOS_MDSMAP].get();