}
-void FSMap::create_filesystem(std::string_view name,
- int64_t metadata_pool, int64_t data_pool,
- uint64_t features)
+std::shared_ptr<Filesystem> FSMap::create_filesystem(std::string_view name,
+ int64_t metadata_pool, int64_t data_pool, uint64_t features)
{
auto fs = std::make_shared<Filesystem>();
fs->mds_map.epoch = epoch;
if (filesystems.size() == 1) {
legacy_client_fscid = fs->fscid;
}
+
+ return fs;
}
void FSMap::reset_filesystem(fs_cluster_id_t fscid)
* Caller must already have validated all arguments vs. the existing
* FSMap and OSDMap contents.
*/
- void create_filesystem(std::string_view name,
- int64_t metadata_pool, int64_t data_pool,
- uint64_t features);
+ std::shared_ptr<Filesystem> create_filesystem(
+ std::string_view name, int64_t metadata_pool,
+ int64_t data_pool, uint64_t features);
/**
* Remove the filesystem (it must exist). Caller should already
mon->osdmon()->propose_pending();
// All checks passed, go ahead and create.
- fsmap.create_filesystem(fs_name, metadata, data,
- mon->get_quorum_con_features());
+ auto fs = fsmap.create_filesystem(fs_name, metadata, data,
+ mon->get_quorum_con_features());
+
ss << "new fs with metadata pool " << metadata << " and data pool " << data;
+
+ // assign a standby to rank 0 to avoid health warnings
+ std::string _name;
+ mds_gid_t gid = fsmap.find_replacement_for({fs->fscid, 0}, _name,
+ g_conf->mon_force_standby_active);
+
+ if (gid != MDS_GID_NONE) {
+ const auto &info = fsmap.get_info_gid(gid);
+ mon->clog->info() << info.human_name() << " assigned to filesystem "
+ << fs_name << " as rank 0";
+ fsmap.promote(gid, fs, 0);
+ }
+
return 0;
}
if [ $new -eq 1 ]; then
if [ "$CEPH_NUM_FS" -gt "0" ] ; then
+ sleep 5 # time for MDS to come up as standby to avoid health warnings on fs creation
if [ "$CEPH_NUM_FS" -gt "1" ] ; then
ceph_adm fs flag set enable_multiple true --yes-i-really-mean-it
fi