From: Sage Weil Date: Tue, 10 Sep 2019 18:51:25 +0000 (-0500) Subject: mgr/MgrClient: empty target string for 'tell' means active mgr X-Git-Tag: v15.1.0~1323^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=22b0a99de7071aacef1b6abc8eb24e6512c066d2;p=ceph.git mgr/MgrClient: empty target string for 'tell' means active mgr This lets the caller say "tell the active mgr", whoever it may be. Signed-off-by: Sage Weil --- diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index 2e48b703209..87a301c72c3 100644 --- a/src/mgr/MgrClient.cc +++ b/src/mgr/MgrClient.cc @@ -190,9 +190,8 @@ void MgrClient::reconnect() auto& op = p->second; ldout(cct,10) << "resending " << tid << dendl; MessageRef m; - if (op.name.size()) { - if (op.name != map.active_name) { - // FIXME someday! + if (op.tell) { + if (op.name.size() && op.name != map.active_name) { ldout(cct, 10) << "active mgr " << map.active_name << " != target " << op.name << dendl; if (op.on_finish) { @@ -500,6 +499,7 @@ int MgrClient::start_tell_command( } auto &op = command_table.start_command(); + op.tell = true; op.name = name; op.cmd = cmd; op.inbl = inbl; @@ -507,7 +507,7 @@ int MgrClient::start_tell_command( op.outs = outs; op.on_finish = onfinish; - if (session && session->con && map.active_name == name) { + if (session && session->con && (name.size() == 0 || map.active_name == name)) { // Leaving fsid argument null because it isn't used. // Note: this simply won't work we pre-octopus mgrs because they route // MCommand to the cluster command handler. diff --git a/src/mgr/MgrClient.h b/src/mgr/MgrClient.h index fa96ff46615..9d5251d9d20 100644 --- a/src/mgr/MgrClient.h +++ b/src/mgr/MgrClient.h @@ -47,6 +47,7 @@ class MgrCommand : public CommandOp { public: std::string name; + bool tell = false; explicit MgrCommand(ceph_tid_t t) : CommandOp(t) {} MgrCommand() : CommandOp() {}