]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: do not populate MMonCommand paxos version field
authorSage Weil <sage@inktank.com>
Wed, 10 Jul 2013 17:17:45 +0000 (10:17 -0700)
committerSage Weil <sage@inktank.com>
Wed, 10 Jul 2013 17:19:38 +0000 (10:19 -0700)
The field is not used or useful since the monitor does not even look
at it (in Monitor::handle_command()).  Avoid populating it and the
subsequent confusion for poor developers.

Signed-off-by: Sage Weil <sage@inktank.com>
src/messages/MMonCommand.h
src/mon/MDSMonitor.cc
src/mon/MonClient.cc
src/mon/Monitor.cc
src/mon/Monitor.h
src/osdc/Objecter.cc

index 2798280935e65d65c316fc7add95373cf8031498..2b79465cfbddac768bf24863872e8cea9b37dbdf 100644 (file)
@@ -26,9 +26,10 @@ class MMonCommand : public PaxosServiceMessage {
   vector<string> cmd;
 
   MMonCommand() : PaxosServiceMessage(MSG_MON_COMMAND, 0) {}
-  MMonCommand(const uuid_d &f, version_t v) : 
-    PaxosServiceMessage(MSG_MON_COMMAND, v),
-    fsid(f) { }
+  MMonCommand(const uuid_d &f)
+    : PaxosServiceMessage(MSG_MON_COMMAND, 0),
+      fsid(f)
+  { }
 
 private:
   ~MMonCommand() {}
index eafb1f04f10f3f0d78cb41b7af7f10d1935d4974..80254660b49c035066b3419be1a51f4d3f830435 100644 (file)
@@ -638,7 +638,7 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
           i != mds_info.end();
           ++i) {
        m->cmd = args_vec;
-       mon->send_command(i->second.get_inst(), m->cmd, get_last_committed());
+       mon->send_command(i->second.get_inst(), m->cmd);
        r = 0;
       }
       if (r == -ENOENT) {
@@ -652,7 +652,7 @@ bool MDSMonitor::preprocess_command(MMonCommand *m)
       if (!errno && who >= 0) {
        if (mdsmap.is_up(who)) {
          m->cmd = args_vec;
-         mon->send_command(mdsmap.get_inst(who), m->cmd, get_last_committed());
+         mon->send_command(mdsmap.get_inst(who), m->cmd);
          r = 0;
          ss << "ok";
        } else {
index f47b5c0ef16f57fc88863146eb6f3f01c5adba80..57f30063fa7c24340287076000bca56a785a9a48 100644 (file)
@@ -726,8 +726,6 @@ int MonClient::wait_auth_rotating(double timeout)
 
 void MonClient::_send_command(MonCommand *r)
 {
-  version_t last_seen_version = 0;
-
   if (r->target_rank >= 0 &&
       r->target_rank != monmap.get_rank(cur_mon)) {
     ldout(cct, 10) << "_send_command " << r->tid << " " << r->cmd
@@ -759,7 +757,7 @@ void MonClient::_send_command(MonCommand *r)
   }
 
   ldout(cct, 10) << "_send_command " << r->tid << " " << r->cmd << dendl;
-  MMonCommand *m = new MMonCommand(monmap.fsid, last_seen_version);
+  MMonCommand *m = new MMonCommand(monmap.fsid);
   m->set_tid(r->tid);
   m->cmd = r->cmd;
   m->set_data(r->inbl);
index a78ad741ede3b4f816ad977a7ad6d7272099f214..aef9acc0a179734a17097f6a537ec52136ee2e89 100644 (file)
@@ -2440,10 +2440,10 @@ void Monitor::remove_all_sessions()
 }
 
 void Monitor::send_command(const entity_inst_t& inst,
-                          const vector<string>& com, version_t version)
+                          const vector<string>& com)
 {
   dout(10) << "send_command " << inst << "" << com << dendl;
-  MMonCommand *c = new MMonCommand(monmap->fsid, version);
+  MMonCommand *c = new MMonCommand(monmap->fsid);
   c->cmd = com;
   try_send_message(c, inst);
 }
index cbc91529c214c162ffebd1d090793cecbaed9cc3..863f4e5de38c116c073085b94481659fd815c0a2 100644 (file)
@@ -634,7 +634,7 @@ public:
   void waitlist_or_zap_client(Message *m);
 
   void send_command(const entity_inst_t& inst,
-                   const vector<string>& com, version_t version);
+                   const vector<string>& com);
 
 public:
   struct C_Command : public Context {
index 45b4573bbb1fd5a15a564fd9029a46cefff7781d..a5a023cb33e66e8628ea66fa7495a9b66df20558 100644 (file)
@@ -2361,7 +2361,7 @@ void Objecter::blacklist_self(bool set)
   ss << messenger->get_myaddr();
   cmd.push_back("\"addr\":\"" + ss.str() + "\"");
 
-  MMonCommand *m = new MMonCommand(monc->get_fsid(), last_seen_osdmap_version);
+  MMonCommand *m = new MMonCommand(monc->get_fsid());
   m->cmd = cmd;
 
   monc->send_mon_message(m);