]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: use forward_message, orig_source_inst throughout
authorSage Weil <sage@newdream.net>
Tue, 1 Jul 2008 14:25:06 +0000 (07:25 -0700)
committerSage Weil <sage@newdream.net>
Tue, 1 Jul 2008 14:25:06 +0000 (07:25 -0700)
19 files changed:
src/TODO
src/cmonctl.cc
src/fakefuse.cc
src/fakesyn.cc
src/include/ceph_fs.h
src/mds/MDS.cc
src/messages/MMDSBeacon.h
src/messages/MMonCommand.h
src/messages/MOSDBoot.h
src/messages/MOSDFailure.h
src/messages/MPGStats.h
src/mon/MDSMonitor.cc
src/mon/Monitor.cc
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc
src/mon/PaxosService.cc
src/osd/OSD.cc
src/osdc/Objecter.cc
src/vstartnew.sh

index 1e29b26354d1458e924410e82b4ca0bce8f67bdd..e675eca1de22ef084d20bbf76b833e842c7dffd1 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -1,4 +1,5 @@
 v0.3
+- fix mon osdmap send_full/latest ... never use get_source_inst()!
 
 v0.4
 - fix msgr protocol wrt resets, and varying connection close policies
index 32663f6d581b84120aa149496b99f6a11d4e6c94..44a8dfe31affb3bd74564b0e27ac59a930715cf0 100644 (file)
@@ -144,7 +144,7 @@ int main(int argc, const char **argv, const char *envp[]) {
   messenger->set_dispatcher(&dispatcher);
   
   // build command
-  MMonCommand *m = new MMonCommand(monmap.fsid, messenger->get_myinst());
+  MMonCommand *m = new MMonCommand(monmap.fsid);
   m->set_data(indata);
   m->cmd.swap(vcmd);
   int mon = monmap.pick_mon();
index f799b1ff1c8a69d28f08add9b5ae43cec09cd906..9dce514d28577ac173228764d1e8938fa2a9ffb2 100644 (file)
@@ -127,7 +127,7 @@ int main(int argc, const char **argv) {
     bufferlist bl;
     map.encode(bl);
     Messenger *messenger = new FakeMessenger(entity_name_t::ADMIN(-1));
-    MMonCommand *m = new MMonCommand(monmap->fsid, messenger->get_myinst());
+    MMonCommand *m = new MMonCommand(monmap->fsid);
     m->set_data(bl);
     m->cmd.push_back("osd");
     m->cmd.push_back("setmap");
index 4828238689383a88f2ae149629cb6670b62c4df7..213d4285cd3f47ae272c2de6595b96609ab2642e 100644 (file)
@@ -126,7 +126,7 @@ int main(int argc, const char **argv)
     bufferlist bl;
     map.encode(bl);
     Messenger *messenger = new FakeMessenger(entity_name_t::ADMIN(-1));
-    MMonCommand *m = new MMonCommand(monmap->fsid, messenger->get_myinst());
+    MMonCommand *m = new MMonCommand(monmap->fsid);
     m->set_data(bl);
     m->cmd.push_back("osd");
     m->cmd.push_back("setmap");
index d1149aff1dc29d1217fdb843120bf0e35b2a7dc2..0652a80074bebf7cb619334cdd78e68b2c4f21d9 100644 (file)
@@ -374,7 +374,7 @@ struct ceph_msg_header {
        __le32 front_len;
        __le32 data_off;  /* sender: include full offset; receiver: mask against ~PAGE_MASK */
        __le32 data_len;  /* bytes of data payload */
-       struct ceph_entity_inst src, dst;
+       struct ceph_entity_inst src, orig_src, dst;
 } __attribute__ ((packed));
 
 struct ceph_msg_footer {
index 1b3c82f73d81c5da681f9d4c2adbac397777f014..6ae7e70389e7cc84fa6e370b27b934fa8e557637 100644 (file)
@@ -386,7 +386,7 @@ void MDS::beacon_send()
   beacon_seq_stamp[beacon_last_seq] = g_clock.now();
   
   int mon = monmap->pick_mon();
-  messenger->send_message(new MMDSBeacon(monmap->fsid, messenger->get_myinst(), mdsmap->get_epoch(), 
+  messenger->send_message(new MMDSBeacon(monmap->fsid, mdsmap->get_epoch(), 
                                         want_state, beacon_last_seq, want_rank),
                          monmap->get_inst(mon));
 
index 133bc396dea011c72f98487fbb92c76577c44d52..b64f8ca0823d4f0ede6eaeb719412f06603ba8fa 100644 (file)
@@ -23,7 +23,6 @@
 
 class MMDSBeacon : public Message {
   ceph_fsid fsid;
-  entity_inst_t inst;
   epoch_t last_epoch_seen;  // include last mdsmap epoch mds has seen to avoid race with monitor decree
   __u32 state;
   version_t seq;
@@ -31,12 +30,11 @@ class MMDSBeacon : public Message {
 
  public:
   MMDSBeacon() : Message(MSG_MDS_BEACON) {}
-  MMDSBeacon(ceph_fsid &f, entity_inst_t i, epoch_t les, int st, version_t se, int wr) : 
+  MMDSBeacon(ceph_fsid &f, epoch_t les, int st, version_t se, int wr) : 
     Message(MSG_MDS_BEACON), 
-    fsid(f), inst(i), last_epoch_seen(les), state(st), seq(se), want_rank(wr) { }
+    fsid(f), last_epoch_seen(les), state(st), seq(se), want_rank(wr) { }
 
   ceph_fsid& get_fsid() { return fsid; }
-  entity_inst_t& get_mds_inst() { return inst; }
   epoch_t get_last_epoch_seen() { return last_epoch_seen; }
   int get_state() { return state; }
   version_t get_seq() { return seq; }
@@ -44,14 +42,12 @@ class MMDSBeacon : public Message {
   int get_want_rank() { return want_rank; }
 
   void print(ostream& out) {
-    out << "mdsbeacon(" << inst
-       << " " << MDSMap::get_state_name(state) 
+    out << "mdsbeacon(" << MDSMap::get_state_name(state) 
        << " seq " << seq << ")";
   }
   
   void encode_payload() {
     ::encode(fsid, payload);
-    ::encode(inst, payload);
     ::encode(last_epoch_seen, payload);
     ::encode(state, payload);
     ::encode(seq, payload);
@@ -60,7 +56,6 @@ class MMDSBeacon : public Message {
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
     ::decode(fsid, p);
-    ::decode(inst, p);
     ::decode(last_epoch_seen, p);
     ::decode(state, p);
     ::decode(seq, p);
index 0c92b8ef2b33695a42259893c5772ac70f6c5919..d5fdc78ad1523c89d16af7d59250fc1851f0a8da 100644 (file)
@@ -23,13 +23,12 @@ using std::vector;
 class MMonCommand : public Message {
  public:
   ceph_fsid fsid;
-  entity_inst_t inst;
   vector<string> cmd;
 
   MMonCommand() : Message(MSG_MON_COMMAND) {}
-  MMonCommand(ceph_fsid &f, entity_inst_t i) : 
+  MMonCommand(ceph_fsid &f) : 
     Message(MSG_MON_COMMAND),
-    fsid(f), inst(i) { }
+    fsid(f) { }
   
   const char *get_type_name() { return "mon_command"; }
   void print(ostream& o) {
@@ -43,13 +42,11 @@ class MMonCommand : public Message {
   
   void encode_payload() {
     ::encode(fsid, payload);
-    ::encode(inst, payload);
     ::encode(cmd, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
     ::decode(fsid, p);
-    ::decode(inst, p);
     ::decode(cmd, p);
   }
 };
index 8e22755dfc4a77a6e7c1933cee51b81dee055a58..90d30bfe6e7356a9e4265240ec1c55b919855ff3 100644 (file)
 
 class MOSDBoot : public Message {
  public:
-  entity_inst_t inst;
   OSDSuperblock sb;
 
   MOSDBoot() {}
-  MOSDBoot(entity_inst_t i, OSDSuperblock& s) : 
+  MOSDBoot(OSDSuperblock& s) : 
     Message(MSG_OSD_BOOT),
-    inst(i),
     sb(s) {
   }
 
   const char *get_type_name() { return "osd_boot"; }
   void print(ostream& out) {
-    out << "osd_boot(" << inst << ")";
+    out << "osd_boot(osd" << sb.whoami << ")";
   }
   
   void encode_payload() {
-    ::encode(inst, payload);
     ::encode(sb, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
-    ::decode(inst, p);
     ::decode(sb, p);
   }
 };
index 264abbf957f256718c53632707274ee3296a0773..6a11a9fdd21f652c70f9701241949f90e8ccb741 100644 (file)
 class MOSDFailure : public Message {
  public:
   ceph_fsid fsid;
-  entity_inst_t from;
   entity_inst_t failed;
   epoch_t       epoch;
 
   MOSDFailure() : Message(MSG_OSD_FAILURE) {}
-  MOSDFailure(ceph_fsid &fs, entity_inst_t fr, entity_inst_t f, epoch_t e) : 
+  MOSDFailure(ceph_fsid &fs, entity_inst_t f, epoch_t e) : 
     Message(MSG_OSD_FAILURE),
-    fsid(fs), from(fr), failed(f), epoch(e) {}
+    fsid(fs), failed(f), epoch(e) {}
  
-  entity_inst_t get_from() { return from; }
   entity_inst_t get_failed() { return failed; }
   epoch_t get_epoch() { return epoch; }
 
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
     ::decode(fsid, p);
-    ::decode(from, p);
     ::decode(failed, p);
     ::decode(epoch, p);
   }
   void encode_payload() {
     ::encode(fsid, payload);
-    ::encode(from, payload);
     ::encode(failed, payload);
     ::encode(epoch, payload);
   }
index 95f67b74902e4eac6703e6a407f36fb8ab23d7f6..31d721f31b08c80ddfa63aeec73328e1e60a2c76 100644 (file)
@@ -21,7 +21,6 @@ class MPGStats : public Message {
 public:
   map<pg_t,pg_stat_t> pg_stat;
   osd_stat_t osd_stat;
-  entity_inst_t orig_src;
   
   MPGStats() : Message(MSG_PGSTATS) {}
 
@@ -33,13 +32,11 @@ public:
   void encode_payload() {
     ::encode(osd_stat, payload);
     ::encode(pg_stat, payload);
-    ::encode(orig_src, payload);
   }
   void decode_payload() {
     bufferlist::iterator p = payload.begin();
     ::decode(osd_stat, p);
     ::decode(pg_stat, p);
-    ::decode(orig_src, p);
   }
 };
 
index 7d6a7493669e1e15600826612db85fc6aa2a76c5..37683ef19ed6d0f03b10502bba24307bd36206f0 100644 (file)
@@ -176,7 +176,7 @@ void MDSMonitor::encode_pending(bufferlist &bl)
 
 bool MDSMonitor::preprocess_query(Message *m)
 {
-  dout(10) << "preprocess_query " << *m << " from " << m->get_source_inst() << dendl;
+  dout(10) << "preprocess_query " << *m << " from " << m->get_orig_source_inst() << dendl;
 
   switch (m->get_type()) {
     
@@ -200,16 +200,16 @@ bool MDSMonitor::preprocess_query(Message *m)
 void MDSMonitor::handle_mds_getmap(MMDSGetMap *m)
 {
   if (m->want <= mdsmap.get_epoch())
-    send_full(m->get_source_inst());
+    send_full(m->get_orig_source_inst());
   else
-    waiting_for_map.push_back(m->get_source_inst());
+    waiting_for_map.push_back(m->get_orig_source_inst());
 }
 
 
 bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
 {
-  int from = m->get_mds_inst().name.num();
-  entity_addr_t addr = m->get_mds_inst().addr;
+  int from = m->get_orig_source_inst().name.num();
+  entity_addr_t addr = m->get_orig_source_inst().addr;
   int state = m->get_state();
   version_t seq = m->get_seq();
 
@@ -218,22 +218,13 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
     goto out;
   }
 
-  // first time we've seen it?
-  if (m->get_mds_inst().addr.ipaddr.sin_addr.s_addr == htonl(INADDR_ANY)) {
-    m->get_mds_inst() = m->get_source_inst();
-    m->clear_payload();
-  }
-
   dout(12) << "preprocess_beacon " << *m
-          << " from " << m->get_mds_inst()
+          << " from " << m->get_orig_source_inst()
           << dendl;
 
   // fw to leader?
-  if (!mon->is_leader()) {
-    dout(10) << "fw to leader" << dendl;
-    mon->messenger->send_message(m, mon->monmap->get_inst(mon->get_leader()));
-    return true;
-  }
+  if (!mon->is_leader())
+    return false;
 
   // can i handle this query without a map update?
   
@@ -278,9 +269,9 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m)
   // note time and reply
   dout(15) << "mds_beacon " << *m << " noting time and replying" << dendl;
   last_beacon[addr] = g_clock.now();  
-  mon->messenger->send_message(new MMDSBeacon(mon->monmap->fsid, m->get_mds_inst(), 
+  mon->messenger->send_message(new MMDSBeacon(mon->monmap->fsid,
                                              mdsmap.get_epoch(), state, seq, 0), 
-                              m->get_mds_inst());
+                              m->get_orig_source_inst());
 
   // done
  out:
@@ -315,10 +306,10 @@ bool MDSMonitor::handle_beacon(MMDSBeacon *m)
 {
   // -- this is an update --
   dout(12) << "handle_beacon " << *m
-          << " from " << m->get_mds_inst()
+          << " from " << m->get_orig_source_inst()
           << dendl;
-  int from = m->get_mds_inst().name.num();
-  entity_addr_t addr = m->get_mds_inst().addr;
+  int from = m->get_orig_source_inst().name.num();
+  entity_addr_t addr = m->get_orig_source_inst().addr;
   int state = m->get_state();
   version_t seq = m->get_seq();
 
@@ -445,13 +436,13 @@ void MDSMonitor::_updated(int from, MMDSBeacon *m)
 {
   if (from < 0) {
     dout(10) << "_updated (booted) mds" << from << " " << *m << dendl;
-    mon->osdmon->send_latest(m->get_source_inst());
+    mon->osdmon->send_latest(m->get_orig_source_inst());
   } else {
     dout(10) << "_updated mds" << from << " " << *m << dendl;
   }
   if (m->get_state() == MDSMap::STATE_STOPPED) {
     // send the map manually (they're out of the map, so they won't get it automatic)
-    send_latest(m->get_mds_inst());
+    send_latest(m->get_orig_source_inst());
   }
 
   delete m;
index 350fc5f0461b07ffe43d4fb0fdc63bf2c773b5e6..9b7e464ffcc934efdb517b594cf4171975347103 100644 (file)
@@ -203,12 +203,6 @@ void Monitor::handle_command(MMonCommand *m)
     return;
   }
 
-  // first time we've seen it?
-  if (m->inst.addr.ipaddr.sin_addr.s_addr == htonl(INADDR_ANY)) {
-    m->inst = m->get_source_inst();
-    m->clear_payload();
-  }
-
   dout(0) << "handle_command " << *m << dendl;
   string rs;
   if (!m->cmd.empty()) {
@@ -251,7 +245,7 @@ void Monitor::reply_command(MMonCommand *m, int rc, const string &rs, bufferlist
 {
   MMonCommandAck *reply = new MMonCommandAck(rc, rs);
   reply->set_data(rdata);
-  messenger->send_message(reply, m->inst);
+  messenger->send_message(reply, m->get_orig_source_inst());
   delete m;
 }
 
index 855c78750b96adca5e6af3c8ec77eeb14794ef74..ffefc3ace1965e1024b7e6beda9e052ab8d96c36 100644 (file)
@@ -256,7 +256,7 @@ void OSDMonitor::committed()
 
 bool OSDMonitor::preprocess_query(Message *m)
 {
-  dout(10) << "preprocess_query " << *m << " from " << m->get_source_inst() << dendl;
+  dout(10) << "preprocess_query " << *m << " from " << m->get_orig_source_inst() << dendl;
 
   switch (m->get_type()) {
     // READs
@@ -288,7 +288,7 @@ bool OSDMonitor::preprocess_query(Message *m)
 
 bool OSDMonitor::prepare_update(Message *m)
 {
-  dout(7) << "prepare_update " << *m << " from " << m->get_source_inst() << dendl;
+  dout(7) << "prepare_update " << *m << " from " << m->get_orig_source_inst() << dendl;
   
   switch (m->get_type()) {
     // damp updates
@@ -344,7 +344,7 @@ bool OSDMonitor::should_propose(double& delay)
 
 void OSDMonitor::handle_osd_getmap(MOSDGetMap *m)
 {
-  dout(7) << "handle_osd_getmap from " << m->get_source()
+  dout(7) << "handle_osd_getmap from " << m->get_orig_source()
          << " start " << m->get_start_epoch()
          << dendl;
   
@@ -355,11 +355,11 @@ void OSDMonitor::handle_osd_getmap(MOSDGetMap *m)
 
   if (m->get_start_epoch()) {
     if (m->get_start_epoch() <= osdmap.get_epoch())
-       send_incremental(m->get_source_inst(), m->get_start_epoch());
+       send_incremental(m->get_orig_source_inst(), m->get_start_epoch());
     else
-      waiting_for_map[m->get_source_inst()] = m->get_start_epoch();
+      waiting_for_map[m->get_orig_source_inst()] = m->get_start_epoch();
   } else
-    send_full(m->get_source_inst());
+    send_full(m->get_orig_source_inst());
   
  out:
   delete m;
@@ -391,13 +391,13 @@ bool OSDMonitor::preprocess_failure(MOSDFailure *m)
    */
 
   // first, verify the reporting host is valid
-  if (m->get_source().is_osd()) {
-    int from = m->get_source().num();
+  if (m->get_orig_source().is_osd()) {
+    int from = m->get_orig_source().num();
     if (!osdmap.exists(from) ||
-       osdmap.get_addr(from) != m->get_source_inst().addr ||
+       osdmap.get_addr(from) != m->get_orig_source_inst().addr ||
        osdmap.is_down(from)) {
       dout(5) << "preprocess_failure from dead osd" << from << ", ignoring" << dendl;
-      send_incremental(m->get_from(), m->get_epoch()+1);
+      send_incremental(m->get_orig_source_inst(), m->get_epoch()+1);
       goto didit;
     }
   }
@@ -405,27 +405,27 @@ bool OSDMonitor::preprocess_failure(MOSDFailure *m)
 
   // weird?
   if (!osdmap.have_inst(badboy)) {
-    dout(5) << "preprocess_failure dne(/dup?): " << m->get_failed() << ", from " << m->get_from() << dendl;
+    dout(5) << "preprocess_failure dne(/dup?): " << m->get_failed() << ", from " << m->get_orig_source_inst() << dendl;
     if (m->get_epoch() < osdmap.get_epoch())
-      send_incremental(m->get_from(), m->get_epoch()+1);
+      send_incremental(m->get_orig_source_inst(), m->get_epoch()+1);
     goto didit;
   }
   if (osdmap.get_inst(badboy) != m->get_failed()) {
     dout(5) << "preprocess_failure wrong osd: report " << m->get_failed() << " != map's " << osdmap.get_inst(badboy)
-           << ", from " << m->get_from() << dendl;
+           << ", from " << m->get_orig_source_inst() << dendl;
     if (m->get_epoch() < osdmap.get_epoch())
-      send_incremental(m->get_from(), m->get_epoch()+1);
+      send_incremental(m->get_orig_source_inst(), m->get_epoch()+1);
     goto didit;
   }
   // already reported?
   if (osdmap.is_down(badboy)) {
-    dout(5) << "preprocess_failure dup: " << m->get_failed() << ", from " << m->get_from() << dendl;
+    dout(5) << "preprocess_failure dup: " << m->get_failed() << ", from " << m->get_orig_source_inst() << dendl;
     if (m->get_epoch() < osdmap.get_epoch())
-      send_incremental(m->get_from(), m->get_epoch()+1);
+      send_incremental(m->get_orig_source_inst(), m->get_epoch()+1);
     goto didit;
   }
 
-  dout(10) << "preprocess_failure new: " << m->get_failed() << ", from " << m->get_from() << dendl;
+  dout(10) << "preprocess_failure new: " << m->get_failed() << ", from " << m->get_orig_source_inst() << dendl;
   return false;
 
  didit:
@@ -435,7 +435,7 @@ bool OSDMonitor::preprocess_failure(MOSDFailure *m)
 
 bool OSDMonitor::prepare_failure(MOSDFailure *m)
 {
-  dout(1) << "prepare_failure " << m->get_failed() << " from " << m->get_from() << dendl;
+  dout(1) << "prepare_failure " << m->get_failed() << " from " << m->get_orig_source_inst() << dendl;
   
   // FIXME
   // take their word for it
@@ -455,8 +455,8 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m)
 
 void OSDMonitor::_reported_failure(MOSDFailure *m)
 {
-  dout(7) << "_reported_failure on " << m->get_failed() << ", telling " << m->get_from() << dendl;
-  send_latest(m->get_from(), m->get_epoch());
+  dout(7) << "_reported_failure on " << m->get_failed() << ", telling " << m->get_orig_source_inst() << dendl;
+  send_latest(m->get_orig_source_inst(), m->get_epoch());
   delete m;
 }
 
@@ -471,33 +471,27 @@ bool OSDMonitor::preprocess_boot(MOSDBoot *m)
     return true;
   }
 
-  // first time we've seen it?
-  if (m->inst.addr.ipaddr.sin_addr.s_addr == htonl(INADDR_ANY)) {
-    m->inst = m->get_source_inst();
-    m->clear_payload();
-  }
-
-  assert(m->inst.name.is_osd());
-  int from = m->inst.name.num();
+  assert(m->get_orig_source_inst().name.is_osd());
+  int from = m->get_orig_source_inst().name.num();
   
   // already booted?
   if (osdmap.is_up(from) &&
-      osdmap.get_inst(from) == m->inst) {
+      osdmap.get_inst(from) == m->get_orig_source_inst()) {
     // yup.
-    dout(7) << "preprocess_boot dup from " << m->inst << dendl;
+    dout(7) << "preprocess_boot dup from " << m->get_orig_source_inst() << dendl;
     _booted(m);
     return true;
   }
   
-  dout(10) << "preprocess_boot from " << m->inst << dendl;
+  dout(10) << "preprocess_boot from " << m->get_orig_source_inst() << dendl;
   return false;
 }
 
 bool OSDMonitor::prepare_boot(MOSDBoot *m)
 {
-  dout(7) << "prepare_boot from " << m->inst << dendl;
-  assert(m->inst.name.is_osd());
-  int from = m->inst.name.num();
+  dout(7) << "prepare_boot from " << m->get_orig_source_inst() << dendl;
+  assert(m->get_orig_source().is_osd());
+  int from = m->get_orig_source().num();
   
   // does this osd exist?
   if (!osdmap.exists(from)) {
@@ -509,7 +503,7 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m)
   // already up?  mark down first?
   if (osdmap.is_up(from)) {
     dout(7) << "prepare_boot was up, first marking down " << osdmap.get_inst(from) << dendl;
-    assert(osdmap.get_inst(from) != m->inst);  // preproces should have caught it
+    assert(osdmap.get_inst(from) != m->get_orig_source_inst());  // preproces should have caught it
     
     // mark previous guy down
     pending_inc.new_down[from] = false;
@@ -518,7 +512,7 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m)
   } else {
     // mark new guy up.
     down_pending_out.erase(from);  // if any
-    pending_inc.new_up[from] = m->inst.addr;
+    pending_inc.new_up[from] = m->get_orig_source_addr();
     
     // mark in?
     pending_inc.new_offload[from] = CEPH_OSD_IN;
@@ -534,8 +528,9 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m)
 
 void OSDMonitor::_booted(MOSDBoot *m)
 {
-  dout(7) << "_booted " << m->inst << " w " << m->sb.weight << " from " << m->sb.current_epoch << dendl;
-  send_latest(m->inst, m->sb.current_epoch+1);
+  dout(7) << "_booted " << m->get_orig_source_inst() 
+         << " w " << m->sb.weight << " from " << m->sb.current_epoch << dendl;
+  send_latest(m->get_orig_source_inst(), m->sb.current_epoch+1);
   delete m;
 }
 
@@ -545,25 +540,26 @@ void OSDMonitor::_booted(MOSDBoot *m)
 
 bool OSDMonitor::preprocess_alive(MOSDAlive *m)
 {
-  int from = m->get_source().num();
+  int from = m->get_orig_source().num();
   if (osdmap.is_up(from) &&
-      osdmap.get_inst(from) == m->get_source_inst() &&
+      osdmap.get_inst(from) == m->get_orig_source_inst() &&
       osdmap.get_up_thru(from) >= m->map_epoch) {
     // yup.
-    dout(7) << "preprocess_alive e" << m->map_epoch << " dup from " << m->get_source_inst() << dendl;
+    dout(7) << "preprocess_alive e" << m->map_epoch << " dup from " << m->get_orig_source_inst() << dendl;
     _alive(m);
     return true;
   }
   
-  dout(10) << "preprocess_alive e" << m->map_epoch << " from " << m->get_source_inst() << dendl;
+  dout(10) << "preprocess_alive e" << m->map_epoch
+          << " from " << m->get_orig_source_inst() << dendl;
   return false;
 }
 
 bool OSDMonitor::prepare_alive(MOSDAlive *m)
 {
-  int from = m->get_source().num();
+  int from = m->get_orig_source().num();
 
-  dout(7) << "prepare_alive e" << m->map_epoch << " from " << m->get_source_inst() << dendl;
+  dout(7) << "prepare_alive e" << m->map_epoch << " from " << m->get_orig_source_inst() << dendl;
   pending_inc.new_up_thru[from] = m->map_epoch;
   paxos->wait_for_commit(new C_Alive(this,m ));
   return true;
@@ -572,9 +568,9 @@ bool OSDMonitor::prepare_alive(MOSDAlive *m)
 void OSDMonitor::_alive(MOSDAlive *m)
 {
   dout(7) << "_alive e" << m->map_epoch
-         << " from " << m->get_source_inst()
+         << " from " << m->get_orig_source_inst()
          << dendl;
-  send_latest(m->get_source_inst(), m->map_epoch);
+  send_latest(m->get_orig_source_inst(), m->map_epoch);
   delete m;
 }
 
index e0f30fbe58f009952ec868753809f06e4ca39c86..656bbf30a02dc8145300889e695b94d6a21d9b65 100644 (file)
@@ -170,7 +170,7 @@ void PGMonitor::encode_pending(bufferlist &bl)
 
 bool PGMonitor::preprocess_query(Message *m)
 {
-  dout(10) << "preprocess_query " << *m << " from " << m->get_source_inst() << dendl;
+  dout(10) << "preprocess_query " << *m << " from " << m->get_orig_source_inst() << dendl;
   switch (m->get_type()) {
   case CEPH_MSG_STATFS:
     handle_statfs((MStatfs*)m);
@@ -180,10 +180,7 @@ bool PGMonitor::preprocess_query(Message *m)
     {
       MPGStats *stats = (MPGStats*)m;
 
-      if (!stats->get_source().is_mon())
-       stats->orig_src = stats->get_source_inst();
-
-      int from = m->get_source().num();
+      int from = m->get_orig_source().num();
       if (pg_map.osd_stat.count(from) ||
          memcmp(&pg_map.osd_stat[from], &stats->osd_stat, sizeof(stats->osd_stat)) != 0)
        return false;  // new osd stat
@@ -201,7 +198,7 @@ bool PGMonitor::preprocess_query(Message *m)
           p != stats->pg_stat.end();
           p++)
        ack->pg_stat[p->first] = p->second.reported;
-      mon->messenger->send_message(ack, stats->orig_src);
+      mon->messenger->send_message(ack, stats->get_orig_source_inst());
       return true;
     }
 
@@ -217,7 +214,7 @@ bool PGMonitor::preprocess_query(Message *m)
 
 bool PGMonitor::prepare_update(Message *m)
 {
-  dout(10) << "prepare_update " << *m << " from " << m->get_source_inst() << dendl;
+  dout(10) << "prepare_update " << *m << " from " << m->get_orig_source_inst() << dendl;
   switch (m->get_type()) {
   case MSG_PGSTATS:
     return prepare_pg_stats((MPGStats*)m);
@@ -240,7 +237,7 @@ void PGMonitor::committed()
 
 void PGMonitor::handle_statfs(MStatfs *statfs)
 {
-  dout(10) << "handle_statfs " << *statfs << " from " << statfs->get_source() << dendl;
+  dout(10) << "handle_statfs " << *statfs << " from " << statfs->get_orig_source() << dendl;
 
   // fill out stfs
   MStatfsReply *reply = new MStatfsReply(statfs->tid);
@@ -253,17 +250,17 @@ void PGMonitor::handle_statfs(MStatfs *statfs)
   reply->stfs.f_objects = pg_map.total_osd_num_objects;
 
   // reply
-  mon->messenger->send_message(reply, statfs->get_source_inst());
+  mon->messenger->send_message(reply, statfs->get_orig_source_inst());
   delete statfs;
 }
 
 bool PGMonitor::prepare_pg_stats(MPGStats *stats) 
 {
-  dout(10) << "prepare_pg_stats " << *stats << " from " << stats->get_source() << dendl;
-  int from = stats->get_source().num();
-  if (!stats->get_source().is_osd() ||
+  dout(10) << "prepare_pg_stats " << *stats << " from " << stats->get_orig_source() << dendl;
+  int from = stats->get_orig_source().num();
+  if (!stats->get_orig_source().is_osd() ||
       !mon->osdmon->osdmap.is_up(from) ||
-      stats->get_source_inst() != mon->osdmon->osdmap.get_inst(from)) {
+      stats->get_orig_source_inst() != mon->osdmon->osdmap.get_inst(from)) {
     dout(1) << " ignoring stats from non-active osd" << dendl;
   }
       
@@ -314,7 +311,7 @@ bool PGMonitor::prepare_pg_stats(MPGStats *stats)
     pg_map.stat_pg_add(pgid, pg_map.pg_stat[pgid]);
   }
   
-  paxos->wait_for_commit(new C_Stats(this, ack, stats->orig_src));
+  paxos->wait_for_commit(new C_Stats(this, ack, stats->get_orig_source_inst()));
   delete stats;
   return true;
 }
index 186b58d4f0949a9cc522ed350e27b10eb42a1b22..1a07a05d87909399f2d8209fa3008ef7972542de 100644 (file)
@@ -51,7 +51,7 @@ void PaxosService::dispatch(Message *m)
   if (!mon->is_leader()) {
     // fw to leader
     dout(10) << " fw to leader mon" << mon->get_leader() << dendl;
-    mon->messenger->send_message(m, mon->monmap->get_inst(mon->get_leader()));
+    mon->messenger->forward_message(m, mon->monmap->get_inst(mon->get_leader()));
     return;
   }
   
index 01ed7442eb5e0576c85a0673f39f7a946aef5c02..5c753c195719db92ba2d42fd3dbb6e71a501faa5 100644 (file)
@@ -1020,7 +1020,7 @@ void OSD::send_boot()
 {
   int mon = monmap->pick_mon();
   dout(10) << "send_boot to mon" << mon << dendl;
-  messenger->send_message(new MOSDBoot(messenger->get_myinst(), superblock), 
+  messenger->send_message(new MOSDBoot(superblock), 
                          monmap->get_inst(mon));
 }
 
@@ -1063,8 +1063,7 @@ void OSD::send_failures()
   int mon = monmap->pick_mon();
   while (!failure_queue.empty()) {
     int osd = *failure_queue.begin();
-    messenger->send_message(new MOSDFailure(monmap->fsid, messenger->get_myinst(), 
-                                           osdmap->get_inst(osd), osdmap->get_epoch()),
+    messenger->send_message(new MOSDFailure(monmap->fsid, osdmap->get_inst(osd), osdmap->get_epoch()),
                            monmap->get_inst(mon));
     failure_queue.erase(osd);
   }
index 2a94f9a03e0643062131f20c4bb459a8734a202e..be8ddc3ec0ff0e21721a294558dd405b2f97105f 100644 (file)
@@ -1022,8 +1022,7 @@ void Objecter::ms_handle_failure(Message *m, entity_name_t dest, const entity_in
       dout(0) << "ms_handle_failure " << dest << " inst " << inst 
              << ", dropping, reporting to mon" << mon 
              << dendl;
-      messenger->send_message(new MOSDFailure(monmap->fsid, messenger->get_myinst(), inst, 
-                                             osdmap->get_epoch()), 
+      messenger->send_message(new MOSDFailure(monmap->fsid, inst, osdmap->get_epoch()), 
                              monmap->get_inst(mon));
     }
     delete m;
index 0a981c95027e5f87b5ed45f23392b7c559639365..9378b688895e070446cbd910ba5f0e3fee62cf09 100755 (executable)
@@ -34,7 +34,7 @@ done
 $CEPH_BIN/osdmaptool --clobber --createsimple .ceph_monmap 4 --print .ceph_osdmap # --pgbits 2
 $CEPH_BIN/cmonctl osd setmap -i .ceph_osdmap
 
-for osd in 0 #1 2 3 #4 5 6 7 8 9 10 11 12 13 14 15
+for osd in 0 1 2 3 #4 5 6 7 8 9 10 11 12 13 14 15
 do
  $CEPH_BIN/cosd --mkfs_for_osd $osd dev/osd$osd  # initialize empty object store
  #valgrind --leak-check=full --show-reachable=yes $CEPH_BIN/cosd dev/osd$osd --debug_ms 1 --debug_osd 20 --debug_filestore 10 1>out/o$osd & #--debug_osd 40