]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fill in osd uuid in map on boot
authorSage Weil <sage@newdream.net>
Tue, 1 May 2012 23:13:12 +0000 (16:13 -0700)
committerSage Weil <sage@newdream.net>
Tue, 1 May 2012 23:13:12 +0000 (16:13 -0700)
We may want to make this more strict, so that if it is defined it has to
match the map, and only fill it in when the map's uuid is still zeroed
(for legacy clusters)...

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc

index c7f1564d98d039e8a5e0016da15a5119717f12cc..9558c8181940f80c2e86413a99b232e932f05729 100644 (file)
@@ -812,6 +812,11 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m)
     if (m->sb.weight)
       osd_weight[from] = m->sb.weight;
 
+    // set uuid?
+    dout(10) << " setting osd." << from << " uuid to " << m->sb.osd_fsid << dendl;
+    if (osdmap.get_uuid(from) != m->sb.osd_fsid)
+      pending_inc.new_uuid[from] = m->sb.osd_fsid;
+
     // fresh osd?
     if (m->sb.newest_map == 0 && osdmap.exists(from)) {
       const osd_info_t& i = osdmap.get_info(from);
@@ -2048,6 +2053,8 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
   done:
       dout(10) << " creating osd." << i << dendl;
       pending_inc.new_state[i] |= CEPH_OSD_EXISTS | CEPH_OSD_NEW;
+      if (!uuid.is_zero())
+       pending_inc.new_uuid[i] = uuid;
       ss << i;
       getline(ss, rs);
       paxos->wait_for_commit(new Monitor::C_Command(mon, m, 0, rs, paxos->get_version()));