]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: move monc->set_want_keys() before monc->init()
authorKefu Chai <kchai@redhat.com>
Thu, 1 Dec 2016 14:27:30 +0000 (06:27 -0800)
committerKefu Chai <kchai@redhat.com>
Tue, 14 Feb 2017 04:58:22 +0000 (12:58 +0800)
if monc's tick connect to the mon before monc.set_want_keys() is called,
monc won't ask for the key for MDS service, and hence will fail to
build_authorizer() for MDS service. this change ready us for the
feature of monc-connect-to-mon-in-parallel.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/client/Client.cc

index b1ffba576d81bf7ab0f8e1d8ed2524c4c37339dc..d0ba9f9aa9570e11abf9908f9af49ebef7780b4c 100644 (file)
@@ -476,6 +476,7 @@ int Client::init()
   messenger->add_dispatcher_tail(objecter);
   messenger->add_dispatcher_tail(this);
 
+  monclient->set_want_keys(CEPH_ENTITY_TYPE_MDS | CEPH_ENTITY_TYPE_OSD);
   int r = monclient->init();
   if (r < 0) {
     // need to do cleanup because we're in an intermediate init state
@@ -488,8 +489,6 @@ int Client::init()
   }
   objecter->start();
 
-  monclient->set_want_keys(CEPH_ENTITY_TYPE_MDS | CEPH_ENTITY_TYPE_OSD);
-
   // logger
   PerfCountersBuilder plb(cct, "client", l_c_first, l_c_last);
   plb.add_time_avg(l_c_reply, "reply", "Latency of receiving a reply on metadata request");