From: Greg Farnum Date: Fri, 25 Mar 2016 00:50:43 +0000 (-0700) Subject: Merge branch 'wip-mfsmap-features' of git://github.com/jcsp/ceph X-Git-Tag: v10.1.1~115 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f474c23d7c619fe014bd4cf42cab12802f1e4e2c;p=ceph.git Merge branch 'wip-mfsmap-features' of git://github.com/jcsp/ceph Clean up some code in the new multi-fs handling. Make its output more precise and add some debug/repair config options. Reviewed-by: Greg Farnum Conflicts: src/mds/FSMap.cc Signed-off-by: Greg Farnum --- f474c23d7c619fe014bd4cf42cab12802f1e4e2c diff --cc src/mds/FSMap.cc index 094b78e01e16b,e35c61488b146..38610bc9d09fc --- a/src/mds/FSMap.cc +++ b/src/mds/FSMap.cc @@@ -213,43 -230,21 +230,43 @@@ void FSMap::get_health(list fs_list; - for (auto i : filesystems) { - fs_list.push_back(*(i.second)); + if (features & CEPH_FEATURE_SERVER_JEWEL) { + ENCODE_START(6, 6, bl); + ::encode(epoch, bl); + ::encode(next_filesystem_id, bl); + ::encode(legacy_client_fscid, bl); + ::encode(compat, bl); + ::encode(enable_multiple, bl); + std::vector fs_list; + for (auto i : filesystems) { + fs_list.push_back(*(i.second)); + } - ::encode(fs_list, bl); ++ ::encode(fs_list, bl, features); + ::encode(mds_roles, bl); + ::encode(standby_daemons, bl, features); + ::encode(standby_epochs, bl); + ENCODE_FINISH(bl); + } else { + if (filesystems.empty()) { + MDSMap disabled_map; + disabled_map.epoch = epoch; + disabled_map.encode(bl, features); + } else { + // MDSMonitor should never have created multiple filesystems + // until the quorum features indicated Jewel + assert(filesystems.size() == 1); + auto fs = filesystems.begin()->second; + + // Take the MDSMap for the enabled filesystem, and populated its + // mds_info with the standbys to get a pre-jewel-style mon MDSMap. + MDSMap full_mdsmap = fs->mds_map; + full_mdsmap.epoch = epoch; + for (const auto p : standby_daemons) { + full_mdsmap.mds_info[p.first] = p.second; + } + full_mdsmap.encode(bl, features); + } } - ::encode(fs_list, bl, features); - ::encode(mds_roles, bl); - ::encode(standby_daemons, bl, features); - ::encode(standby_epochs, bl); - ENCODE_FINISH(bl); } void FSMap::decode(bufferlist::iterator& p)