From: Patrick Donnelly Date: Sun, 6 May 2018 02:59:22 +0000 (-0700) Subject: mds: refactor MDSMap init X-Git-Tag: v13.1.1~8^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e35e4d1e6869740ead0ca85cab4ffd94b45e0320;p=ceph.git mds: refactor MDSMap init Signed-off-by: Patrick Donnelly (cherry picked from commit 7be74fd004686dc12c3c6b8d2be5f83cb2f3dea8) --- diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 25cdc407e4fb9..cd8d41c22ecac 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -170,25 +170,26 @@ public: protected: // base map - epoch_t epoch; - bool enabled; - std::string fs_name; - uint32_t flags; // flags - epoch_t last_failure; // mds epoch of last failure - epoch_t last_failure_osd_epoch; // osd epoch of last failure; any mds entering replay needs + epoch_t epoch = 0; + bool enabled = false; + std::string fs_name = MDS_FS_NAME_DEFAULT; + uint32_t flags = CEPH_MDSMAP_DEFAULTS; // flags + epoch_t last_failure = 0; // mds epoch of last failure + epoch_t last_failure_osd_epoch = 0; // osd epoch of last failure; any mds entering replay needs // at least this osdmap to ensure the blacklist propagates. - utime_t created, modified; + utime_t created; + utime_t modified; - mds_rank_t tableserver; // which MDS has snaptable - mds_rank_t root; // which MDS has root directory + mds_rank_t tableserver = 0; // which MDS has snaptable + mds_rank_t root = 0; // which MDS has root directory - __u32 session_timeout; - __u32 session_autoclose; - uint64_t max_file_size; + __u32 session_timeout = 60; + __u32 session_autoclose = 300; + uint64_t max_file_size = 1ULL<<40; /* 1TB */ std::vector data_pools; // file data pools available to clients (via an ioctl). first is the default. - int64_t cas_pool; // where CAS objects go - int64_t metadata_pool; // where fs metadata objects go + int64_t cas_pool = -1; // where CAS objects go + int64_t metadata_pool = -1; // where fs metadata objects go /* * in: the set of logical mds #'s that define the cluster. this is the set @@ -200,9 +201,9 @@ protected: * @up + @failed = @in. @in * @stopped = {}. */ - mds_rank_t max_mds; /* The maximum number of active MDSes. Also, the maximum rank. */ - mds_rank_t old_max_mds; /* Value to restore when MDS cluster is marked up */ - mds_rank_t standby_count_wanted; + mds_rank_t max_mds = 1; /* The maximum number of active MDSes. Also, the maximum rank. */ + mds_rank_t old_max_mds = 0; /* Value to restore when MDS cluster is marked up */ + mds_rank_t standby_count_wanted = -1; string balancer; /* The name/version of the mantle balancer (i.e. the rados obj name) */ std::set in; // currently defined cluster @@ -212,12 +213,12 @@ protected: std::map up; // who is in those roles std::map mds_info; - uint8_t ever_allowed_features; //< bitmap of features the cluster has allowed - uint8_t explicitly_allowed_features; //< bitmap of features explicitly enabled + uint8_t ever_allowed_features = 0; //< bitmap of features the cluster has allowed + uint8_t explicitly_allowed_features = 0; //< bitmap of features explicitly enabled - bool inline_data_enabled; + bool inline_data_enabled = false; - uint64_t cached_up_features; + uint64_t cached_up_features = 0; public: CompatSet compat; @@ -227,25 +228,6 @@ public: friend class FSMap; public: - MDSMap() - : epoch(0), enabled(false), fs_name(MDS_FS_NAME_DEFAULT), - flags(CEPH_MDSMAP_DEFAULTS), last_failure(0), - last_failure_osd_epoch(0), - tableserver(0), root(0), - session_timeout(60), - session_autoclose(300), - max_file_size(1ULL<<40), /* 1TB */ - cas_pool(-1), - metadata_pool(-1), - max_mds(1), - old_max_mds(0), - standby_count_wanted(-1), - ever_allowed_features(0), - explicitly_allowed_features(0), - inline_data_enabled(false), - cached_up_features(0) - { } - bool get_inline_data_enabled() const { return inline_data_enabled; } void set_inline_data_enabled(bool enabled) { inline_data_enabled = enabled; }