From: weill Date: Tue, 13 Oct 2015 08:21:54 +0000 (-0400) Subject: Init crush_location in Objecter from config file. X-Git-Tag: v10.0.0~66^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1deb31dfa4c6156a251dc7b6bea5c0cd203f3a8f;p=ceph.git Init crush_location in Objecter from config file. Fixes: #13473 Signed-off-by: Wei Luo --- diff --git a/src/librados/RadosClient.cc b/src/librados/RadosClient.cc index 08ed909448bf..a01ae7d45813 100644 --- a/src/librados/RadosClient.cc +++ b/src/librados/RadosClient.cc @@ -266,8 +266,6 @@ int librados::RadosClient::connect() lock.Unlock(); - cct->_conf->call_all_observers(); - ldout(cct, 1) << "init done" << dendl; err = 0; diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 60efe3ae469d..87f7257ae6c1 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -163,17 +163,21 @@ void Objecter::handle_conf_change(const struct md_config_t *conf, const std::set &changed) { if (changed.count("crush_location")) { - crush_location.clear(); - vector lvec; - get_str_vec(cct->_conf->crush_location, ";, \t", lvec); - int r = CrushWrapper::parse_loc_multimap(lvec, &crush_location); - if (r < 0) { - lderr(cct) << "warning: crush_location '" << cct->_conf->crush_location - << "' does not parse" << dendl; - } + update_crush_location(); } } +void Objecter::update_crush_location() +{ + crush_location.clear(); + vector lvec; + get_str_vec(cct->_conf->crush_location, ";, \t", lvec); + int r = CrushWrapper::parse_loc_multimap(lvec, &crush_location); + if (r < 0) { + lderr(cct) << "warning: crush_location '" << cct->_conf->crush_location + << "' does not parse" << dendl; + } +} // messages ------------------------------ @@ -288,6 +292,7 @@ void Objecter::init() timer.init(); timer_lock.Unlock(); + update_crush_location(); cct->_conf->add_observer(this); initialized.set(1); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 379c0ae02734..c3e32c68ef21 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1112,6 +1112,7 @@ private: void schedule_tick(); void tick(); + void update_crush_location(); class RequestStateHook : public AdminSocketHook { Objecter *m_objecter;