From e6e3fa84d7ef1b4e31954cc787227977a301d6b8 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 25 Feb 2020 18:08:22 -0600 Subject: [PATCH] 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 --- src/mon/Monitor.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; -- 2.47.3