From 79f3f3011299628cb0558ed432d12477413a6e58 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 1 Dec 2016 06:27:30 -0800 Subject: [PATCH] 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 --- src/client/Client.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index b1ffba576d8..d0ba9f9aa95 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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");