From: Sage Weil Date: Wed, 26 Feb 2020 00:08:22 +0000 (-0600) Subject: mon/Monitor: fail forwarded tell commands X-Git-Tag: v15.1.1~204^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e6e3fa84d7ef1b4e31954cc787227977a301d6b8;p=ceph.git mon/Monitor: fail forwarded tell commands 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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 49acde967c5c..13fc886ab15a 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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;