From: Patrick Donnelly Date: Thu, 18 Apr 2024 19:40:19 +0000 (-0400) Subject: mon/MgrMonitor: only drop active if exists X-Git-Tag: v18.2.5~46^2~12 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b4e8fb7a6611b693ae52f889eeeb8e551025dec5;p=ceph.git mon/MgrMonitor: only drop active if exists This avoids an assertion in ::drop_active. Signed-off-by: Patrick Donnelly (cherry picked from commit 3fca1187460cdd05c08879b19840d78d787da9b0) --- diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index 580fd0da5fa95..74cfa71138600 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -1220,12 +1220,15 @@ bool MgrMonitor::prepare_command(MonOpRequestRef op) return r; } if (enable_down) { - if (!mon.osdmon()->is_writeable()) { + bool has_active = !!pending_map.active_gid; + if (has_active && !mon.osdmon()->is_writeable()) { mon.osdmon()->wait_for_writeable(op, new C_RetryMessage(this, op)); return false; } pending_map.flags |= MgrMap::FLAG_DOWN; - plugged |= drop_active(); + if (has_active) { + plugged |= drop_active(); + } } else { pending_map.flags &= ~(MgrMap::FLAG_DOWN); }