MCPcopy Create free account
hub / github.com/ceph/ceph / handle_update

Method handle_update

src/mgr/DaemonServer.cc:650–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

648}
649
650bool DaemonServer::handle_update(const ref_t<MMgrUpdate>& m)
651{
652 DaemonKey key;
653 if (!m->service_name.empty()) {
654 key.type = m->service_name;
655 } else {
656 key.type = ceph_entity_type_name(m->get_connection()->get_peer_type());
657 }
658 key.name = m->daemon_name;
659
660 dout(10) << "from " << m->get_connection() << " " << key << dendl;
661
662 if (m->get_connection()->get_peer_type() == entity_name_t::TYPE_CLIENT &&
663 m->service_name.empty()) {
664 // Clients should not be sending us update request
665 dout(10) << "rejecting update request from non-daemon client " << m->daemon_name
666 << dendl;
667 clog->warn() << "rejecting report from non-daemon client " << m->daemon_name
668 << " at " << m->get_connection()->get_peer_addrs();
669 m->get_connection()->mark_down();
670 return true;
671 }
672
673
674 {
675 std::unique_lock locker(lock);
676
677 DaemonStatePtr daemon;
678 // Look up the DaemonState
679 if (daemon_state.exists(key)) {
680 dout(20) << "updating existing DaemonState for " << key << dendl;
681
682 daemon = daemon_state.get(key);
683 if (m->need_metadata_update &&
684 !m->daemon_metadata.empty()) {
685 daemon_state.update_metadata(daemon, m->daemon_metadata);
686 }
687 }
688 }
689
690 return true;
691}
692
693bool DaemonServer::handle_close(const ref_t<MMgrClose>& m)
694{

Callers

nothing calls this directly

Calls 10

ceph_entity_type_nameFunction · 0.85
get_peer_addrsMethod · 0.80
emptyMethod · 0.45
get_peer_typeMethod · 0.45
get_connectionMethod · 0.45
warnMethod · 0.45
mark_downMethod · 0.45
existsMethod · 0.45
getMethod · 0.45
update_metadataMethod · 0.45

Tested by

no test coverage detected