]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds/FSMap: remove support for encoding jewel FSMap
authorSage Weil <sage@redhat.com>
Sat, 23 Mar 2019 07:00:25 +0000 (02:00 -0500)
committerSage Weil <sage@redhat.com>
Tue, 2 Apr 2019 21:19:43 +0000 (16:19 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/FSMap.cc

index 0663152430995c017c7c1ea5f1a573e215c9595b..0ba39f2f7be2efb55212348851c3d0be39e06219 100644 (file)
@@ -283,17 +283,10 @@ Filesystem::ref FSMap::create_filesystem(std::string_view name,
   fs->mds_map.created = ceph_clock_now();
   fs->mds_map.modified = ceph_clock_now();
   fs->mds_map.enabled = true;
-  if (features & CEPH_FEATURE_SERVER_JEWEL) {
-    fs->fscid = next_filesystem_id++;
-    // ANONYMOUS is only for upgrades from legacy mdsmaps, we should
-    // have initialized next_filesystem_id such that it's never used here.
-    ceph_assert(fs->fscid != FS_CLUSTER_ID_ANONYMOUS);
-  } else {
-    // Use anon fscid because this will get thrown away when encoding
-    // as legacy MDSMap for legacy mons.
-    ceph_assert(filesystems.empty());
-    fs->fscid = FS_CLUSTER_ID_ANONYMOUS;
-  }
+  fs->fscid = next_filesystem_id++;
+  // ANONYMOUS is only for upgrades from legacy mdsmaps, we should
+  // have initialized next_filesystem_id such that it's never used here.
+  ceph_assert(fs->fscid != FS_CLUSTER_ID_ANONYMOUS);
   filesystems[fs->fscid] = fs;
 
   // Created first filesystem?  Set it as the one
@@ -418,54 +411,23 @@ void FSMap::get_health_checks(health_check_map_t *checks) const
 
 void FSMap::encode(bufferlist& bl, uint64_t features) const
 {
-  if (features & CEPH_FEATURE_SERVER_JEWEL) {
-    ENCODE_START(7, 6, bl);
-    encode(epoch, bl);
-    encode(next_filesystem_id, bl);
-    encode(legacy_client_fscid, bl);
-    encode(compat, bl);
-    encode(enable_multiple, bl);
-    {
-      std::vector<Filesystem::ref> v;
-      v.reserve(filesystems.size());
-      for (auto& p : filesystems) v.emplace_back(p.second);
-      encode(v, bl, features);
-    }
-    encode(mds_roles, bl);
-    encode(standby_daemons, bl, features);
-    encode(standby_epochs, bl);
-    encode(ever_enabled_multiple, 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
-      ceph_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;
-      }
-
-      // Old MDSMaps don't set rank on standby replay daemons
-      for (auto &i : full_mdsmap.mds_info) {
-        auto &info = i.second;
-        if (info.state == MDSMap::STATE_STANDBY_REPLAY) {
-          info.rank = MDS_RANK_NONE;
-        }
-      }
-
-      full_mdsmap.encode(bl, features);
-    }
-  }
+  ENCODE_START(7, 6, bl);
+  encode(epoch, bl);
+  encode(next_filesystem_id, bl);
+  encode(legacy_client_fscid, bl);
+  encode(compat, bl);
+  encode(enable_multiple, bl);
+  {
+    std::vector<Filesystem::ref> v;
+    v.reserve(filesystems.size());
+    for (auto& p : filesystems) v.emplace_back(p.second);
+    encode(v, bl, features);
+  }
+  encode(mds_roles, bl);
+  encode(standby_daemons, bl, features);
+  encode(standby_epochs, bl);
+  encode(ever_enabled_multiple, bl);
+  ENCODE_FINISH(bl);
 }
 
 void FSMap::decode(bufferlist::const_iterator& p)