]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: implement 'mds setmap <epoch>' to (re)set mdsmap
authorSage Weil <sage@newdream.net>
Wed, 17 Jun 2009 16:53:39 +0000 (09:53 -0700)
committerSage Weil <sage@newdream.net>
Wed, 17 Jun 2009 17:34:23 +0000 (10:34 -0700)
src/mon/MDSMonitor.cc

index 86470fbf1e51dd15d9158912391849be83070f15..a6663d24dc4cb7361f92a5e1d8a0e3abffd1551a 100644 (file)
@@ -470,6 +470,22 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
       r = 0;
       ss << "max_mds = " << pending_mdsmap.max_mds;
     }
+    else if (m->cmd[1] == "setmap" && m->cmd.size() == 3) {
+      MDSMap map;
+      map.decode(m->get_data());
+      epoch_t e = atoi(m->cmd[2].c_str());
+      //if (ceph_fsid_compare(&map.get_fsid(), &mon->monmap->fsid) == 0) {
+      if (pending_mdsmap.epoch == e) {
+       map.epoch = pending_mdsmap.epoch;  // make sure epoch is correct
+       pending_mdsmap = map;
+       string rs = "set mds map";
+       paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs));
+       return true;
+      } else
+       ss << "next mdsmap epoch " << pending_mdsmap.epoch << " != " << e;
+       //} else
+       //ss << "mdsmap fsid " << map.fsid << " does not match monitor fsid " << mon->monmap->fsid;
+    }
   }
   if (r == -EINVAL) 
     ss << "unrecognized command";