Skip to content

Commit

Permalink
osd/OSDMap: clear osd_info, osd_xinfo on osd deletion
Browse files Browse the repository at this point in the history
If we destroy an OSD in the map, clear not just the uuid but also
all the metadata about it.

Specifically, we care about up_from, which can prevent a new
OSD from booting if it starts with a map prior to the deletion
when it sends it boot.

Note that this changes the result of applying an incremental.
As such, it will cause lots of old OSDs to request full maps
from the mon, spiking load during an upgrade.  This is as it
should be.

Fixes: #13988
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Dec 11, 2015
1 parent c6cdc33 commit 6933d96
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/osd/OSDMap.cc
Expand Up @@ -1347,9 +1347,21 @@ int OSDMap::apply_incremental(const Incremental &inc)
osd_xinfo[i->first].down_stamp = modified;
}
if ((osd_state[i->first] & CEPH_OSD_EXISTS) &&
(s & CEPH_OSD_EXISTS))
(s & CEPH_OSD_EXISTS)) {
// osd is destroyed; clear out anything interesting.
(*osd_uuid)[i->first] = uuid_d();
osd_state[i->first] ^= s;
osd_info[i->first] = osd_info_t();
osd_xinfo[i->first] = osd_xinfo_t();
osd_weight[i->first] = CEPH_OSD_IN;
(*osd_primary_affinity)[i->first] = CEPH_OSD_DEFAULT_PRIMARY_AFFINITY;
osd_addrs->client_addr[i->first].reset(new entity_addr_t());
osd_addrs->cluster_addr[i->first].reset(new entity_addr_t());
osd_addrs->hb_front_addr[i->first].reset(new entity_addr_t());
osd_addrs->hb_back_addr[i->first].reset(new entity_addr_t());
osd_state[i->first] = 0;
} else {
osd_state[i->first] ^= s;
}
}
for (map<int32_t,entity_addr_t>::const_iterator i = inc.new_up_client.begin();
i != inc.new_up_client.end();
Expand Down

0 comments on commit 6933d96

Please sign in to comment.