]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Preparing the monitor to recieve keys from the MDS
authoranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 29 Jan 2007 07:49:16 +0000 (07:49 +0000)
committeranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 29 Jan 2007 07:49:16 +0000 (07:49 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1048 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/messages/MOSDBoot.h
branches/aleung/security1/ceph/mon/OSDMonitor.cc
branches/aleung/security1/ceph/osd/OSD.cc

index 8e38fdedd99229f79134a261a6c1995afb7f241d..d18803b74eb72b1c76622ba9b9b4358b988f3d97 100644 (file)
@@ -33,6 +33,8 @@ class MOSDBoot : public Message {
   }
 
   char *get_type_name() { return "oboot"; }
+
+  string get_public_key() { return public_key_str; }
   
   void encode_payload() {
     payload.append((char*)&sb, sizeof(sb));
index 7fafbff48b2f1d58c3437ea2357f53833284ee80..b6bc774ed825047926ef43782933c8588968922a 100644 (file)
@@ -118,8 +118,9 @@ void OSDMonitor::init()
 
 
 /************ MAPS ****************/
-
-
+/**********
+ * Creates an initital OSD map
+ **********/
 void OSDMonitor::create_initial()
 {
   dout(1) << "create_initial generating osdmap from g_conf" << endl;
@@ -128,6 +129,7 @@ void OSDMonitor::create_initial()
   osdmap.mon_epoch = mon->mon_epoch;
   osdmap.ctime = g_clock.now();
 
+  // set up osd placement groups
   if (g_conf.osd_pg_bits) {
     osdmap.set_pg_bits(g_conf.osd_pg_bits);
   } else {
@@ -205,6 +207,8 @@ void OSDMonitor::create_initial()
     }
   }
   
+  /* Adds MDS OSDs to the map, they need keys...
+   This just adds them to the set in the map */
   if (g_conf.mds_local_osd) {
     // add mds osds, but don't put them in the crush mapping func
     for (int i=0; i<g_conf.num_mds; i++) 
@@ -384,10 +388,13 @@ void OSDMonitor::handle_osd_boot(MOSDBoot *m)
   
   if (osdmap.get_epoch() == 0) {
     // waiting for boot!
+    // add the OSD instance to the map?
     osdmap.osd_inst[from] = m->get_source_inst();
+    // adds the key to the map
+    osdmap.osd_keys[from] = m->get_public_key();
 
     if (osdmap.osd_inst.size() == osdmap.osds.size()) {
-      dout(-7) << "osd_boot all osds booted." << endl;
+      dout(7) << "osd_boot all osds booted." << endl;
       osdmap.inc_epoch();
       
       save_map();
@@ -403,7 +410,8 @@ void OSDMonitor::handle_osd_boot(MOSDBoot *m)
     }
     return;
   }
-  
+  // if epoch != 0 then its incremental
+
   // already up?  mark down first?
   if (osdmap.is_up(from)) {
     pending_inc.new_down[from] = osdmap.osd_inst[from];
index cd43e3e1e4ebd0e74f649a28c358fba5b4d97f28..d4d42f47daf68e04a448525147290d8d7346ae38 100644 (file)
@@ -263,6 +263,8 @@ int OSD::init()
                                               static_dequeueop,
                                               this);
     }
+
+    // convert public key to string
     
     // i'm ready!
     messenger->set_dispatcher(this);