class CephContext;
class health_check_map_t;
-extern CompatSet get_mdsmap_compat_set_all();
-extern CompatSet get_mdsmap_compat_set_default();
-extern CompatSet get_mdsmap_compat_set_base(); // pre v0.20
-
#define MDS_FEATURE_INCOMPAT_BASE CompatSet::Feature(1, "base v0.20")
#define MDS_FEATURE_INCOMPAT_CLIENTRANGES CompatSet::Feature(2, "client writeable ranges")
#define MDS_FEATURE_INCOMPAT_FILELAYOUT CompatSet::Feature(3, "default file layouts on dirs")
void encode_unversioned(bufferlist& bl) const;
};
+ static CompatSet get_compat_set_all();
+ static CompatSet get_compat_set_default();
+ static CompatSet get_compat_set_base(); // pre v0.20
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<int64_t> 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
* @up + @failed = @in. @in * @stopped = {}.
*/
- mds_rank_t max_mds; /* The maximum number of active MDSes. Also, the maximum rank. */
- 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 standby_count_wanted = -1;
string balancer; /* The name/version of the mantle balancer (i.e. the rados obj name) */
std::set<mds_rank_t> in; // currently defined cluster
std::map<mds_rank_t, mds_gid_t> up; // who is in those roles
std::map<mds_gid_t, mds_info_t> 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;
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(0),
- session_autoclose(0),
- max_file_size(0),
- cas_pool(-1),
- metadata_pool(-1),
- 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; }
s.insert(p.second.rank);
}
- void
- get_clientreplay_or_active_or_stopping_mds_set(std::set<mds_rank_t>& s) const {
+ void get_mds_set_lower_bound(std::set<mds_rank_t>& s, DaemonState first) const {
for (std::map<mds_gid_t, mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
++p)
- if (p->second.state >= STATE_CLIENTREPLAY && p->second.state <= STATE_STOPPING)
+ if (p->second.state >= first && p->second.state <= STATE_STOPPING)
s.insert(p->second.rank);
}
void get_mds_set(std::set<mds_rank_t>& s, DaemonState state) const {