client_messenger(external_messenger),
objecter_messenger(osdc_messenger),
monc(mc),
+ mgrc(cct_, client_messenger),
logger(NULL),
recoverystate_perf(NULL),
store(store_),
objecter_messenger->add_dispatcher_head(service.objecter);
- monc->set_want_keys(CEPH_ENTITY_TYPE_MON | CEPH_ENTITY_TYPE_OSD);
+ monc->set_want_keys(CEPH_ENTITY_TYPE_MON | CEPH_ENTITY_TYPE_OSD
+ | CEPH_ENTITY_TYPE_MGR);
r = monc->init();
if (r < 0)
goto out;
+ mgrc.init();
+ client_messenger->add_dispatcher_head(&mgrc);
+
// tell monc about log_client so it will know about mon session resets
monc->set_log_client(&log_client);
update_log_config();
// subscribe to any pg creations
monc->sub_want("osd_pg_creates", last_pg_create_epoch, 0);
+ // MgrClient needs this (it doesn't have MonClient reference itself)
+ monc->sub_want("mgrmap", 0, 0);
+
// we don't need to ask for an osdmap here; objecter will
//monc->sub_want("osdmap", osdmap->get_epoch(), CEPH_SUBSCRIBE_ONETIME);
return 0;
monout:
+ mgrc.shutdown();
monc->shutdown();
out:
store = 0;
dout(10) << "Store synced" << dendl;
+ mgrc.shutdown();
monc->shutdown();
osd_lock.Unlock();
void OSD::ms_handle_fast_connect(Connection *con)
{
- if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON) {
+ if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON &&
+ con->get_peer_type() != CEPH_ENTITY_TYPE_MGR) {
Session *s = static_cast<Session*>(con->get_priv());
if (!s) {
s = new Session(cct);
void OSD::ms_handle_fast_accept(Connection *con)
{
- if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON) {
+ if (con->get_peer_type() != CEPH_ENTITY_TYPE_MON &&
+ con->get_peer_type() != CEPH_ENTITY_TYPE_MGR) {
Session *s = static_cast<Session*>(con->get_priv());
if (!s) {
s = new Session(cct);
bool OSD::ms_dispatch(Message *m)
{
+ dout(20) << "OSD::ms_dispatch: " << *m << dendl;
if (m->get_type() == MSG_OSD_MARK_ME_DOWN) {
service.got_stop_ack();
m->put();
if (force_new) {
/* the MonClient checks keys every tick(), so we should just wait for that cycle
to get through */
- if (monc->wait_auth_rotating(10) < 0)
+ if (monc->wait_auth_rotating(10) < 0) {
+ derr << "OSD::ms_get_authorizer wait_auth_rotating failed" << dendl;
return false;
+ }
}
*authorizer = monc->auth->build_authorizer(dest_type);
+ derr << "OSD::ms_get_authorizer build_authorizer returned " << *authorizer << dendl;
return *authorizer != NULL;
}
* this makes the 'cluster' consistent w/ monitor's usage.
*/
case CEPH_ENTITY_TYPE_OSD:
+ case CEPH_ENTITY_TYPE_MGR:
authorize_handler = authorize_handler_cluster_registry->get_handler(protocol);
break;
default:
#include "common/Timer.h"
#include "common/WorkQueue.h"
#include "common/AsyncReserver.h"
+#include "common/ceph_context.h"
+
+#include "mgr/MgrClient.h"
+
#include "os/ObjectStore.h"
#include "OSDCap.h"
Messenger *client_messenger;
Messenger *objecter_messenger;
MonClient *monc; // check the "monc helpers" list before accessing directly
+ MgrClient mgrc;
PerfCounters *logger;
PerfCounters *recoverystate_perf;
ObjectStore *store;