]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge PR #31907 into master
authorSage Weil <sage@redhat.com>
Mon, 9 Dec 2019 16:30:26 +0000 (10:30 -0600)
committerSage Weil <sage@redhat.com>
Mon, 9 Dec 2019 16:30:26 +0000 (10:30 -0600)
* refs/pull/31907/head:
mgr/dashboard: properly handle a missing rbd-mirror service status
mgr: cull service daemons when the last instance has been removed
mgr: ensure new daemons are properly indexed by hostname

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
1  2 
src/mgr/DaemonServer.cc
src/pybind/mgr/dashboard/controllers/rbd_mirroring.py

index 7b81ffff027207a8796ba492dec70995b4129352,f7a7badaa51ed3a09855dd02ac5bed0060893845..4b41c35df887102f59c433563a2e67c9aaa41fe8
@@@ -398,27 -397,23 +398,33 @@@ bool DaemonServer::handle_open(const re
  
    DaemonStatePtr daemon;
    if (daemon_state.exists(key)) {
+     dout(20) << "updating existing DaemonState for " << key << dendl;
      daemon = daemon_state.get(key);
    }
 -  if (m->service_daemon && !daemon) {
 -    dout(4) << "constructing new DaemonState for " << key << dendl;
 -    daemon = std::make_shared<DaemonState>(daemon_state.types);
 -    daemon->key = key;
 -    daemon->service_daemon = true;
 -    daemon_state.insert(daemon);
 +  if (!daemon) {
 +    if (m->service_daemon) {
 +      dout(4) << "constructing new DaemonState for " << key << dendl;
 +      daemon = std::make_shared<DaemonState>(daemon_state.types);
 +      daemon->key = key;
 +      daemon->service_daemon = true;
 +      daemon_state.insert(daemon);
 +    } else {
 +      /* A normal Ceph daemon has connected but we are or should be waiting on
 +       * metadata for it. Close the session so that it tries to reconnect.
 +       */
 +      dout(2) << "ignoring open from " << key << " " << con->get_peer_addr()
 +              << "; not ready for session (expect reconnect)" << dendl;
 +      con->mark_down();
 +      return true;
 +    }
    }
    if (daemon) {
-     dout(20) << "updating existing DaemonState for " << m->daemon_name << dendl;
+     if (m->service_daemon) {
+       // update the metadata through the daemon state index to
+       // ensure it's kept up-to-date
+       daemon_state.update_metadata(daemon, m->daemon_metadata);
+     }
      std::lock_guard l(daemon->lock);
      daemon->perf_counters.clear();