From: Leonid Usov Date: Mon, 18 Dec 2023 23:30:01 +0000 (+0200) Subject: MgrMonitor: consider the build config when defining the always-on modules X-Git-Tag: v20.0.0~2206^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c530548c813ae776df53bcc5327da155eb30464;p=ceph.git MgrMonitor: consider the build config when defining the always-on modules Signed-off-by: Leonid Usov --- diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index 3c37865721d0..034f584a95d5 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -70,77 +70,31 @@ static ostream& _prefix(std::ostream *_dout, Monitor &mon, // the system treats always_on_modules as if they provide built-in functionality // by ensuring that they are always enabled. -const static std::map> always_on_modules = { - { - CEPH_RELEASE_OCTOPUS, { - "crash", - "status", - "progress", - "balancer", - "devicehealth", - "orchestrator", - "rbd_support", - "volumes", - "pg_autoscaler", - "telemetry", - } - }, - { - CEPH_RELEASE_PACIFIC, { - "crash", - "status", - "progress", - "balancer", - "devicehealth", - "orchestrator", - "rbd_support", - "volumes", - "pg_autoscaler", - "telemetry", - } - }, - { - CEPH_RELEASE_QUINCY, { - "crash", - "status", - "progress", - "balancer", - "devicehealth", - "orchestrator", - "rbd_support", - "volumes", - "pg_autoscaler", - "telemetry", - } - }, - { - CEPH_RELEASE_REEF, { - "crash", - "status", - "progress", - "balancer", - "devicehealth", - "orchestrator", - "rbd_support", - "volumes", - "pg_autoscaler", - "telemetry", - } - }, - { - CEPH_RELEASE_SQUID, { - "crash", - "status", - "progress", - "balancer", - "devicehealth", - "orchestrator", - "rbd_support", - "volumes", - "pg_autoscaler", - "telemetry", - } - }, +static const std::map>& always_on_modules() { + static const std::set octopus_modules = { + "crash", + "status", + "progress", + "balancer", + "devicehealth", + "orchestrator", +#ifdef WITH_RBD + "rbd_support", +#endif +#ifdef WITH_CEPHFS + "volumes", +#endif + "pg_autoscaler", + "telemetry", + }; + static const std::map> always_on_modules_map = { + { CEPH_RELEASE_OCTOPUS, octopus_modules }, + { CEPH_RELEASE_PACIFIC, octopus_modules }, + { CEPH_RELEASE_QUINCY, octopus_modules }, + { CEPH_RELEASE_REEF, octopus_modules }, + { CEPH_RELEASE_SQUID, octopus_modules }, + }; + return always_on_modules_map; }; // Prefix for mon store of active mgr's command descriptions @@ -190,7 +144,7 @@ void MgrMonitor::create_initial() for (auto& m : tok) { pending_map.modules.insert(m); } - pending_map.always_on_modules = always_on_modules; + pending_map.always_on_modules = always_on_modules(); pending_command_descs = mgr_commands; dout(10) << __func__ << " initial modules " << pending_map.modules << ", always on modules " << pending_map.get_always_on_modules() @@ -769,13 +723,13 @@ void MgrMonitor::on_active() } mon.clog->debug() << "mgrmap e" << map.epoch << ": " << map; assert(HAVE_FEATURE(mon.get_quorum_con_features(), SERVER_NAUTILUS)); - if (pending_map.always_on_modules == always_on_modules) { + if (pending_map.always_on_modules == always_on_modules()) { return; } dout(4) << "always on modules changed, pending " << pending_map.always_on_modules << " != wanted " - << always_on_modules << dendl; - pending_map.always_on_modules = always_on_modules; + << always_on_modules() << dendl; + pending_map.always_on_modules = always_on_modules(); propose_pending(); }