]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: remove inc array from mdsmap
authorJohn Spray <john.spray@redhat.com>
Thu, 7 Apr 2016 11:37:08 +0000 (12:37 +0100)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Fri, 6 May 2016 14:26:51 +0000 (19:56 +0530)
Instead, use the MDSMap epochs to provide the `inc` that
we populate into mds_info_t for use by the daemons.

It is not necessary to respect the current value of inc
in old maps, because the per-rank counters were necessarily
lower numbers than the overall map epoch (incrementing
the counters always corresponded to a map change).

Fixes: http://tracker.ceph.com/issues/15399
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 30a375ebf814245fbbb5155fd39d8ff673f0a32a)

src/mds/FSMap.cc
src/mds/MDSMap.cc
src/mds/MDSMap.h
src/mon/MDSMonitor.cc

index a20bb09b8cebe95a947fe3f8efaea387383b6e3a..9965e21d7134641bf4dc4661a5b27bf7629a9780 100644 (file)
@@ -334,7 +334,8 @@ void FSMap::decode(bufferlist::iterator& p)
     ::decode(legacy_mds_map.modified, p);
     ::decode(legacy_mds_map.tableserver, p);
     ::decode(legacy_mds_map.in, p);
-    ::decode(legacy_mds_map.inc, p);
+    std::map<mds_rank_t,int32_t> inc;  // Legacy field, parse and drop
+    ::decode(inc, p);
     ::decode(legacy_mds_map.up, p);
     ::decode(legacy_mds_map.failed, p);
     ::decode(legacy_mds_map.stopped, p);
@@ -663,7 +664,7 @@ void FSMap::promote(
     mds_map.failed.erase(assigned_rank);
   }
   info.rank = assigned_rank;
-  info.inc = ++mds_map.inc[assigned_rank];
+  info.inc = epoch;
   mds_roles[standby_gid] = filesystem->fscid;
 
   // Update the rank state in Filesystem
index f66fc7a85e4450aca94768923678fb96abef398a..304875c16b11dced52e292afc433ab8c732440b8 100644 (file)
@@ -469,6 +469,13 @@ void MDSMap::mds_info_t::decode(bufferlist::iterator& bl)
 
 void MDSMap::encode(bufferlist& bl, uint64_t features) const
 {
+  std::map<mds_rank_t,int32_t> inc;  // Legacy field, fake it so that
+                                     // old-mon peers have something sane
+                                     // during upgrade
+  for (const auto rank : in) {
+    inc.insert(std::make_pair(rank, epoch));
+  }
+
   if ((features & CEPH_FEATURE_PGID64) == 0) {
     __u16 v = 2;
     ::encode(v, bl);
@@ -573,6 +580,8 @@ void MDSMap::encode(bufferlist& bl, uint64_t features) const
 
 void MDSMap::decode(bufferlist::iterator& p)
 {
+  std::map<mds_rank_t,int32_t> inc;  // Legacy field, parse and drop
+
   cached_up_features = 0;
   DECODE_START_LEGACY_COMPAT_LEN_16(5, 4, 4, p);
   ::decode(epoch, p);
index bb69a75f9d5efa97c11a40aa0d50bcaec624ed3e..2b0fb03499debaa932e4969def38083ebf2a8422 100644 (file)
@@ -203,7 +203,7 @@ protected:
   mds_rank_t max_mds; /* The maximum number of active MDSes. Also, the maximum rank. */
 
   std::set<mds_rank_t> in;              // currently defined cluster
-  std::map<mds_rank_t,int32_t> inc;     // most recent incarnation.
+
   // which ranks are failed, stopped, damaged (i.e. not held by a daemon)
   std::set<mds_rank_t> failed, stopped, damaged;
   std::map<mds_rank_t, mds_gid_t> up;        // who is in those roles
index 00f06a0207f49903ed0f71834c4f1a74c68608ac..c672e0a6b42634413dcfcf658d2e878b36384d0e 100644 (file)
@@ -1732,7 +1732,6 @@ int MDSMonitor::management_command(
 
     // Carry forward what makes sense
     new_fs->fscid = fs->fscid;
-    new_fs->mds_map.inc = fs->mds_map.inc;
     new_fs->mds_map.inline_data_enabled = fs->mds_map.inline_data_enabled;
     new_fs->mds_map.max_mds = g_conf->max_mds;
     new_fs->mds_map.data_pools = fs->mds_map.data_pools;