]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrClient: empty target string for 'tell' means active mgr
authorSage Weil <sage@redhat.com>
Tue, 10 Sep 2019 18:51:25 +0000 (13:51 -0500)
committerSage Weil <sage@redhat.com>
Fri, 4 Oct 2019 14:07:02 +0000 (09:07 -0500)
This lets the caller say "tell the active mgr", whoever it may be.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/MgrClient.cc
src/mgr/MgrClient.h

index 2e48b70320974b4ca5ce23ddc46c09de9844446e..87a301c72c39ca79fe604ae19033ae7fd202a268 100644 (file)
@@ -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.
index fa96ff4661578120cb8aa8077c49b31b28aa527b..9d5251d9d206bd8dfcd20e771aa1fa13a6699b26 100644 (file)
@@ -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() {}