mirror of
https://github.com/ceph/ceph
synced 2024-12-17 17:05:42 +00:00
osd: do not assume we have an osdmap in prepare_to_stop
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
61a298c39c
commit
b084a3877f
@ -4730,11 +4730,12 @@ bool OSDService::prepare_to_stop()
|
||||
if (state != NOT_STOPPING)
|
||||
return false;
|
||||
|
||||
if (get_osdmap()->is_up(whoami)) {
|
||||
OSDMapRef osdmap = get_osdmap();
|
||||
if (osdmap && osdmap->is_up(whoami)) {
|
||||
state = PREPARING_TO_STOP;
|
||||
monc->send_mon_message(new MOSDMarkMeDown(monc->get_fsid(),
|
||||
get_osdmap()->get_inst(whoami),
|
||||
get_osdmap()->get_epoch(),
|
||||
osdmap->get_inst(whoami),
|
||||
osdmap->get_epoch(),
|
||||
false
|
||||
));
|
||||
utime_t now = ceph_clock_now(g_ceph_context);
|
||||
|
Loading…
Reference in New Issue
Block a user