Skip to content

Commit

Permalink
mgr: drop session with Ceph daemon when not ready
Browse files Browse the repository at this point in the history
If the mgr is waiting on daemon metadata from the mons, it has no
DaemonState associated with the daemon yet. If we try to process this
MgrOpen, the metadata sent by the daemon (like its config) will not be
recorded.

Fixes: https://tracker.ceph.com/issues/43037
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 16a1deb)
  • Loading branch information
batrick committed Feb 5, 2020
1 parent 372d184 commit cb48be5
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/mgr/DaemonServer.cc
Expand Up @@ -429,12 +429,22 @@ bool DaemonServer::handle_open(MMgrOpen *m)
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) {
if (m->service_daemon) {
Expand Down

0 comments on commit cb48be5

Please sign in to comment.