diff options
author | Sage Weil <sage@newdream.net> | 2012-05-01 16:13:12 -0700 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-05-01 16:13:12 -0700 |
commit | 78b9ccd371d568b87ade56d8d7c311d7f61c0c5a (patch) | |
tree | d12149f880e931ce348e19fee0681926ef4f4744 | |
parent | ca4311e5e39cec8fad85fad3e67eea968707e9eb (diff) | |
download | ceph-78b9ccd371d568b87ade56d8d7c311d7f61c0c5a.tar.gz |
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 <sage@newdream.net>
-rw-r--r-- | src/mon/OSDMonitor.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c7f1564d98d..9558c818194 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())); |