]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix standby handling in map
authorJohn Spray <john.spray@redhat.com>
Mon, 27 Jul 2015 20:34:32 +0000 (21:34 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 28 Jul 2015 08:05:09 +0000 (09:05 +0100)
I broke this by taking the state from
the old mdsmap instead of the new one.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDSDaemon.cc

index e0c317e8cf7de507d2e3c500ad2eeec2322b7650..5093f594738f4bbc0d216efe0c2ed11ca7c45410 100644 (file)
@@ -815,15 +815,16 @@ void MDSDaemon::handle_mds_map(MMDSMap *m)
     return;
   }
 
+  entity_addr_t addr;
+
   // keep old map, for a moment
   MDSMap *oldmap = mdsmap;
-  const MDSMap::DaemonState new_state = mdsmap->get_state_gid(mds_gid_t(monc->get_global_id()));
-  const int incarnation = mdsmap->get_inc_gid(mds_gid_t(monc->get_global_id()));
-  entity_addr_t addr;
 
   // decode and process
   mdsmap = new MDSMap;
   mdsmap->decode(m->get_encoded());
+  const MDSMap::DaemonState new_state = mdsmap->get_state_gid(mds_gid_t(monc->get_global_id()));
+  const int incarnation = mdsmap->get_inc_gid(mds_gid_t(monc->get_global_id()));
 
   monc->sub_got("mdsmap", mdsmap->get_epoch());