client: move monc->set_want_keys() before monc->init()

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>
This commit is contained in:
Kefu Chai 2016-12-01 06:27:30 -08:00
parent 5871a6f403
commit 79f3f30112

View 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");