From: Sage Weil Date: Tue, 4 Oct 2016 13:23:27 +0000 (-0400) Subject: mgr/MgrMap: initialize all fields X-Git-Tag: v11.0.1~30^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11308%2Fhead;p=ceph.git mgr/MgrMap: initialize all fields Fixes: http://tracker.ceph.com/issues/17492 Signed-off-by: Sage Weil --- diff --git a/src/mon/MgrMap.h b/src/mon/MgrMap.h index 909f40aa0df..d9c8e4eb8ce 100644 --- a/src/mon/MgrMap.h +++ b/src/mon/MgrMap.h @@ -55,15 +55,15 @@ WRITE_CLASS_ENCODER(StandbyInfo) class MgrMap { public: - epoch_t epoch; + epoch_t epoch = 0; - // global_id of the ceph-mgr instance selected as a leader - uint64_t active_gid; - // server address reported by the leader once it is active + /// global_id of the ceph-mgr instance selected as a leader + uint64_t active_gid = 0; + /// server address reported by the leader once it is active entity_addr_t active_addr; - // whether the nominated leader is active (i.e. has initialized its server) - bool available; - // the name (foo in mgr.) of the active daemon + /// whether the nominated leader is active (i.e. has initialized its server) + bool available = false; + /// the name (foo in mgr.) of the active daemon std::string active_name; std::map standbys; @@ -138,10 +138,6 @@ public: } } } - - MgrMap() - : epoch(0), available(false) - {} }; WRITE_CLASS_ENCODER_FEATURES(MgrMap)