]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: Do not set the rank of an MDS in standby-replay
authorGreg Farnum <gregf@hq.newdream.net>
Wed, 8 Dec 2010 17:42:57 +0000 (09:42 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 6 Jan 2011 19:12:14 +0000 (11:12 -0800)
or oneshot-replay modes.

This was causing issues with identification in various circumstances,
and turns out to be unnecessary. The MDS now will set its whoami
variable from the standby_for_rank field if that's appropriate.

Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
src/mds/MDS.cc
src/mon/MDSMonitor.cc

index 672b9cc5c7889afdfa2337628108b7c22b6656c4..7aca8f4d24d8b725563459d50e636050c49821b2 100644 (file)
@@ -854,19 +854,26 @@ void MDS::handle_mds_map(MMDSMap *m)
   }
 
   if (whoami < 0) {
-    if (want_state == MDSMap::STATE_STANDBY) {
-      dout(10) << "dropped out of mdsmap, try to re-add myself" << dendl;
-      want_state = state = MDSMap::STATE_BOOT;
-      goto out;
-    }
-    if (want_state == MDSMap::STATE_BOOT) {
-      dout(10) << "not in map yet" << dendl;
+    if (state == MDSMap::STATE_STANDBY_REPLAY ||
+        state == MDSMap::STATE_ONESHOT_REPLAY) {
+      // fill in whoami from standby-for-rank. If we let this be changed
+      // the logic used to set it here will need to be adjusted.
+      whoami = mdsmap->get_mds_info_gid(monc->get_global_id()).standby_for_rank;
     } else {
-      dout(1) << "handle_mds_map i (" << addr
-             << ") dne in the mdsmap, respawning myself" << dendl;
-      respawn();
+      if (want_state == MDSMap::STATE_STANDBY) {
+        dout(10) << "dropped out of mdsmap, try to re-add myself" << dendl;
+        want_state = state = MDSMap::STATE_BOOT;
+        goto out;
+      }
+      if (want_state == MDSMap::STATE_BOOT) {
+        dout(10) << "not in map yet" << dendl;
+      } else {
+        dout(1) << "handle_mds_map i (" << addr
+            << ") dne in the mdsmap, respawning myself" << dendl;
+        respawn();
+      }
+      goto out;
     }
-    goto out;
   }
 
   // ??
index a9c167c49dfdf7498be004221077c4297f296116..49176eebdce9d9ecd8d613a9a79c4a74f4885cab 100644 (file)
@@ -371,9 +371,6 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
     } else {
       info.state = state;
       info.state_seq = seq;
-      if (state == MDSMap::STATE_STANDBY_REPLAY ||
-          state == MDSMap::STATE_ONESHOT_REPLAY)
-        info.rank = m->get_standby_for_rank();
     }
   }