]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/Monitor: fail forwarded tell commands
authorSage Weil <sage@redhat.com>
Wed, 26 Feb 2020 00:08:22 +0000 (18:08 -0600)
committerSage Weil <sage@redhat.com>
Wed, 26 Feb 2020 19:57:59 +0000 (13:57 -0600)
If we have a mix of pre-octopus and octopus+ mons, the old mon may forward
a tell command.  If we try to process it via the asok/tell queue, we will
assert out when we try to send a reply message (see AnonConnection
impl).  Instead, just reply with an error, and a hint that the command
is failing becuase the cluster is mid-upgrade.

Fixes: https://tracker.ceph.com/issues/44297
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index 49acde967c5cd1ebf9799e86a6085ce864cbf65d..13fc886ab15a8cedb8263e8f8abe9c6f213e30d3 100644 (file)
@@ -3235,6 +3235,19 @@ void Monitor::handle_command(MonOpRequestRef op)
        prefix == "smart" ||
        prefix == "mon_status" ||
        prefix == "heap")) {
+    if (m->get_connection()->get_messenger() == 0) {
+      // Prior to octopus, monitors might forward these messages
+      // around. that was broken at baseline, and if we try to process
+      // this message now, it will assert out when we try to send a
+      // message in reply from the asok/tell worker (see
+      // AnonConnection).  Just reply with an error.
+      dout(5) << __func__ << " failing forwarded command from a (presumably) "
+             << "pre-octopus peer" << dendl;
+      reply_command(
+       op, -EBUSY,
+       "failing forwarded tell command in mixed-version mon cluster", 0);
+      return;
+    }
     dout(5) << __func__ << " passing command to tell/asok" << dendl;
     cct->get_admin_socket()->queue_tell_command(m);
     return;