]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: correctly update up map when taking over for creating|starting mds
authorSage Weil <sage@newdream.net>
Fri, 30 Apr 2010 23:24:34 +0000 (16:24 -0700)
committerSage Weil <sage@newdream.net>
Fri, 30 Apr 2010 23:41:40 +0000 (16:41 -0700)
Otherwise we can get crap like

in <0>
up <{0=4103}>
failed <>
stopped <>
4300: 192.168.141.103:6800/9446 '0' mds0.0 up:creating seq 2

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

index 4825b54a3e66d1d621d65d85c371f21de4c7e09d..4695010460c75f6d4a509f9c7dd92a5706a510f7 100644 (file)
@@ -69,10 +69,8 @@ void MDSMap::print(ostream& out)
   out << "\ncompat " << compat << std::endl;
   out << "\nmax_mds " << max_mds << std::endl;
 
-  set<int> upset;
-  get_up_mds_set(upset);
   out << "in <" << in << ">\n"
-      << "up <" << upset << ">\n"
+      << "up <" << up << ">\n"
       << "failed <" << failed << ">\n"
       << "stopped <" << stopped << ">\n";
 
index f7ebeab1e903bf2c49ec0e3b1aa90a72463d2f14..f4f18f32b3e55306100d2d0952b6e8ec6548d6e6 100644 (file)
@@ -720,13 +720,16 @@ void MDSMonitor::tick()
        default:
          assert(0);
        }
-       si.rank = info.rank;
+
        info.state_seq = seq;
-       if (si.state > 0) {
-         si.inc = ++pending_mdsmap.inc[info.rank];
-         pending_mdsmap.up[info.rank] = sgid;
+       si.rank = info.rank;
+       si.inc = ++pending_mdsmap.inc[info.rank];
+       pending_mdsmap.up[info.rank] = sgid;
+       if (si.state > 0)
          pending_mdsmap.last_failure = pending_mdsmap.epoch;
-
+       if (si.state > 0 ||
+           si.state == MDSMap::STATE_CREATING ||
+           si.state == MDSMap::STATE_STARTING) {
          // blacklist laggy mds
          utime_t until = now;
          until += g_conf.mds_blacklist_interval;