]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include pid in fakemessenger addr.nonce
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 1 Aug 2007 20:46:15 +0000 (20:46 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Wed, 1 Aug 2007 20:46:15 +0000 (20:46 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1584 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/mds/fakefuse.cc
branches/sage/mds/fakesyn.cc
branches/sage/mds/msg/FakeMessenger.cc

index 60dff87a8567c8ac111222540912f186aeb71974..6d1e672946b6a65dbaa825da528298e2c5b6700f 100644 (file)
@@ -86,7 +86,13 @@ int main(int argc, char **argv) {
   if (g_conf.clock_tare) g_clock.tare();
 
   MonMap *monmap = new MonMap(g_conf.num_mon);
-  
+  entity_addr_t a;
+  a.nonce = getpid();
+  for (int i=0; i<g_conf.num_mon; i++) {
+    a.port = i;
+    monmap->mon_inst[i] = entity_inst_t(MSG_ADDR_MON(i), a);  // hack ; see FakeMessenger.cc
+  }
+
   Monitor *mon[g_conf.num_mon];
   for (int i=0; i<g_conf.num_mon; i++) {
     mon[i] = new Monitor(i, new FakeMessenger(MSG_ADDR_MON(i)), monmap);
@@ -104,17 +110,13 @@ int main(int argc, char **argv) {
     mds[i] = new MDS(i, new FakeMessenger(MSG_ADDR_MDS(i)), monmap);
   }
  
-    // init
-  for (int i=0; i<g_conf.num_mon; i++) {
+  // init
+  for (int i=0; i<g_conf.num_mon; i++) 
     mon[i]->init();
-  }
-  for (int i=0; i<NUMMDS; i++) {
-    mds[i]->init();
-  }
-  
-  for (int i=0; i<NUMOSD; i++) {
+  for (int i=0; i<NUMMDS; i++) 
+    mds[i]->init();  
+  for (int i=0; i<NUMOSD; i++) 
     osd[i]->init();
-  }
 
 
   // create client
index e4256db646abbeab0fa66c4724ffeda3ab73aed1..84f06dde83e23e4a545cc2d783524dba7b18b0ee 100644 (file)
@@ -86,6 +86,7 @@ int main(int argc, char **argv)
 
   MonMap *monmap = new MonMap(g_conf.num_mon);
   entity_addr_t a;
+  a.nonce = getpid();
   for (int i=0; i<g_conf.num_mon; i++) {
     a.port = i;
     monmap->mon_inst[i] = entity_inst_t(MSG_ADDR_MON(i), a);  // hack ; see FakeMessenger.cc
@@ -105,7 +106,7 @@ int main(int argc, char **argv)
   OSD *mdsosd[g_conf.num_mds];
   for (int i=0; i<g_conf.num_mds; i++) {
     //cerr << "mds" << i << " on rank " << myrank << " " << hostname << "." << pid << endl;
-    mds[i] = new MDS(-1, new FakeMessenger(MSG_ADDR_MDS_NEW), monmap);
+    mds[i] = new MDS(-1, new FakeMessenger(MSG_ADDR_MDS(i)), monmap);
     if (g_conf.mds_local_osd)
       mdsosd[i] = new OSD(i+10000, new FakeMessenger(MSG_ADDR_OSD(i+10000)), monmap);
     start++;
index b64c37554a5b47ee6efc99baf506edd5840653ff..642175eaaca7af6fdb8438e3141cefe6c591d46f 100644 (file)
@@ -270,7 +270,7 @@ FakeMessenger::FakeMessenger(entity_name_t me)  : Messenger(me)
     _myinst.name = me;
     _myinst.addr.port = nranks++;
     //if (!me.is_mon())
-    //_myinst.addr.nonce = getpid();
+    _myinst.addr.nonce = getpid();
 
     // add to directory
     directory[ _myinst.addr ] = this;
@@ -360,7 +360,8 @@ int FakeMessenger::send_message(Message *m, entity_inst_t inst, int port, int fr
   m->set_source(get_myname(), fromport);
   m->set_source_addr(get_myaddr());
 
-  m->set_dest(inst.name, port);
+  m->set_dest_inst(inst);
+  m->set_dest_port(port);
 
   lock.Lock();
 
@@ -384,7 +385,7 @@ int FakeMessenger::send_message(Message *m, entity_inst_t inst, int port, int fr
     directory[inst.addr]->queue_incoming(m);
   } else {
     dout(0) << "--> " << get_myname() << " -> " << inst.name << " " << *m << " -- " << m
-           << " *** destination DNE ***" 
+           << " *** destination " << inst.addr << " DNE ***" 
            << endl;
     for (map<entity_addr_t, FakeMessenger*>::iterator p = directory.begin();
         p != directory.end();