summaryrefslogtreecommitdiff
path: root/src/osd/OSD.cc
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-05-23 08:49:10 -0700
committerSage Weil <sage@inktank.com>2013-05-23 08:49:10 -0700
commite8d0dc762f6659afe6d2a903e76850deddbf7844 (patch)
treec42022685f6198cb8b63a74e52e32d470e475540 /src/osd/OSD.cc
parentf9ec5a7945518089ffae540649b77ac06f98df5f (diff)
parente09e94424b52ea6695bab46c217b16850b47ec3c (diff)
downloadceph-e8d0dc762f6659afe6d2a903e76850deddbf7844.tar.gz
Merge branch 'next'
Diffstat (limited to 'src/osd/OSD.cc')
-rw-r--r--src/osd/OSD.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index fbc0555ed14..192f5d7a60c 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -4144,21 +4144,20 @@ bool OSDService::prepare_to_stop() {
if (state != NOT_STOPPING)
return false;
- state = PREPARING_TO_STOP;
- monc->send_mon_message(
- new MOSDMarkMeDown(
- monc->get_fsid(),
- get_osdmap()->get_inst(whoami),
- get_osdmap()->get_epoch(),
- false
- ));
- utime_t now = ceph_clock_now(g_ceph_context);
- utime_t timeout;
- timeout.set_from_double(
- now + g_conf->osd_mon_shutdown_timeout);
- while ((ceph_clock_now(g_ceph_context) < timeout) &&
- (state != STOPPING)) {
- is_stopping_cond.WaitUntil(is_stopping_lock, timeout);
+ if (get_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(),
+ false
+ ));
+ utime_t now = ceph_clock_now(g_ceph_context);
+ utime_t timeout;
+ timeout.set_from_double(now + g_conf->osd_mon_shutdown_timeout);
+ while ((ceph_clock_now(g_ceph_context) < timeout) &&
+ (state != STOPPING)) {
+ is_stopping_cond.WaitUntil(is_stopping_lock, timeout);
+ }
}
state = STOPPING;
return true;