From 78b9ccd371d568b87ade56d8d7c311d7f61c0c5a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 May 2012 16:13:12 -0700 Subject: [PATCH] mon: fill in osd uuid in map on boot 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 --- src/mon/OSDMonitor.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c7f1564d98d03..9558c8181940f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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())); -- 2.39.5