]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: allow 'mds getmap [epoch]'
authorSage Weil <sage@newdream.net>
Fri, 13 Mar 2009 22:24:38 +0000 (15:24 -0700)
committerSage Weil <sage@newdream.net>
Fri, 13 Mar 2009 22:24:38 +0000 (15:24 -0700)
src/mon/MDSMonitor.cc

index 67c14fee994a7d7bd801b82933c5dd24e46b724a..637ac8d41b341504d838f22c147fed81160b8a97 100644 (file)
@@ -386,8 +386,22 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
       }
     }
     else if (m->cmd[1] == "getmap") {
-      mdsmap.encode(rdata);
-      ss << "got mdsmap epoch " << mdsmap.get_epoch();
+      if (m->cmd.size() > 2) {
+       epoch_t e = atoi(m->cmd[2].c_str());
+       bufferlist b;
+       mon->store->get_bl_sn(b,"mdsmap",e);
+       if (!b.length()) {
+         r = -ENOENT;
+       } else {
+         MDSMap m;
+         m.decode(b);
+         m.encode(rdata);
+         ss << "got mdsmap epoch " << m.get_epoch();
+       }
+      } else {
+       mdsmap.encode(rdata);
+       ss << "got mdsmap epoch " << mdsmap.get_epoch();
+      }
       r = 0;
     }
     else if (m->cmd[1] == "injectargs" && m->cmd.size() == 4) {