]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Init crush_location in Objecter from config file. 6243/head
authorweill <weilluo@tencent.com>
Tue, 13 Oct 2015 08:21:54 +0000 (04:21 -0400)
committerweill <weilluo@tencent.com>
Tue, 13 Oct 2015 08:21:54 +0000 (04:21 -0400)
Fixes: #13473
Signed-off-by: Wei Luo<weilluo@tencent.com>
src/librados/RadosClient.cc
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 08ed909448bf38bdc51b6434136435ebce963a54..a01ae7d45813603789c97fd38dec202d0c2c75f5 100644 (file)
@@ -266,8 +266,6 @@ int librados::RadosClient::connect()
 
   lock.Unlock();
 
-  cct->_conf->call_all_observers();
-
   ldout(cct, 1) << "init done" << dendl;
   err = 0;
 
index 60efe3ae469d5eafcdb024b7b822c34bf3e72ed1..87f7257ae6c1cff561fc8b242272d9e367ad3c7c 100644 (file)
@@ -163,17 +163,21 @@ void Objecter::handle_conf_change(const struct md_config_t *conf,
                                  const std::set <std::string> &changed)
 {
   if (changed.count("crush_location")) {
-    crush_location.clear();
-    vector<string> 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<string> 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);
index 379c0ae027347be0ab621fcebf7da7b4e247bdf4..c3e32c68ef215928ee2e5713e8926c15ed46de1c 100644 (file)
@@ -1112,6 +1112,7 @@ private:
 
   void schedule_tick();
   void tick();
+  void update_crush_location();
 
   class RequestStateHook : public AdminSocketHook {
     Objecter *m_objecter;