From 5b3e71621f6e925100f8d7b451eb5008b62973f0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 4 Oct 2016 09:23:27 -0400 Subject: [PATCH] mgr/MgrMap: initialize all fields Fixes: http://tracker.ceph.com/issues/17492 Signed-off-by: Sage Weil --- src/mon/MgrMap.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/mon/MgrMap.h b/src/mon/MgrMap.h index 909f40aa0df47..d9c8e4eb8ce41 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) -- 2.39.5