]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #15560 from dmick/master
authorSage Weil <sage@newdream.net>
Fri, 9 Jun 2017 01:38:58 +0000 (20:38 -0500)
committerGitHub <noreply@github.com>
Fri, 9 Jun 2017 01:38:58 +0000 (20:38 -0500)
mgr/DaemonServer.cc: log daemon type string as well as id

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: John Spray <john.spray@redhat.com>
1  2 
src/mgr/DaemonServer.cc

index ab69d627f4d52e2d99ef17a696122c727e36e85e,a8ac275d7cecc9586c14316c71929870d92de319..9446a125744a871bbbfa39090c4a48cffcfddd18
@@@ -260,20 -263,14 +260,19 @@@ void DaemonServer::shutdown(
  
  bool DaemonServer::handle_open(MMgrOpen *m)
  {
-   DaemonKey key(
-       m->get_connection()->get_peer_type(),
-       m->daemon_name);
+   uint32_t type = m->get_connection()->get_peer_type();
+   DaemonKey key(type, m->daemon_name);
  
    dout(4) << "from " << m->get_connection() << " name "
-           << m->daemon_name << dendl;
+           << ceph_entity_type_name(type) << "." << m->daemon_name << dendl;
  
    auto configure = new MMgrConfigure();
 -  configure->stats_period = g_conf->mgr_stats_period;
 +  if (m->get_connection()->get_peer_type() == entity_name_t::TYPE_CLIENT) {
 +    // We don't want clients to send us stats
 +    configure->stats_period = 0;
 +  } else {
 +    configure->stats_period = g_conf->mgr_stats_period;
 +  }
    m->get_connection()->send_message(configure);
  
    if (daemon_state.exists(key)) {
  
  bool DaemonServer::handle_report(MMgrReport *m)
  {
-   DaemonKey key(
-       m->get_connection()->get_peer_type(),
-       m->daemon_name);
+   uint32_t type = m->get_connection()->get_peer_type();
+   DaemonKey key(type, m->daemon_name);
  
    dout(4) << "from " << m->get_connection() << " name "
-           << m->daemon_name << dendl;
+           << ceph_entity_type_name(type) << "." << m->daemon_name << dendl;
  
 +  if (m->get_connection()->get_peer_type() == entity_name_t::TYPE_CLIENT) {
 +    // Clients should not be sending us stats
 +    dout(4) << "rejecting report from client " << m->daemon_name << dendl;
 +    m->put();
 +    return true;
 +  }
 +
    DaemonStatePtr daemon;
    if (daemon_state.exists(key)) {
      dout(20) << "updating existing DaemonState for " << m->daemon_name << dendl;