From 6911df2c834a313f0c545de4c1b309348ea5388a Mon Sep 17 00:00:00 2001 From: Alexander Indenbaum Date: Thu, 25 Jul 2024 09:02:44 +0000 Subject: [PATCH] nvmeof gw monitor: disable by default Signed-off-by: Alexander Indenbaum --- src/mon/Monitor.cc | 8 ++++++++ src/mon/Monitor.h | 7 +++++++ src/mon/mon_types.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 07e6bebab49..7f96d7a6d1d 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -248,7 +248,9 @@ Monitor::Monitor(CephContext* cct_, string nm, MonitorDBStore *s, paxos_service[PAXOS_HEALTH].reset(new HealthMonitor(*this, *paxos, "health")); paxos_service[PAXOS_CONFIG].reset(new ConfigMonitor(*this, *paxos, "config")); paxos_service[PAXOS_KV].reset(new KVMonitor(*this, *paxos, "kv")); +#ifdef WITH_NVMEOF_GATEWAY_MONITOR paxos_service[PAXOS_NVMEGW].reset(new NVMeofGwMon(*this, *paxos, "nvmeofgw")); +#endif bool r = mon_caps.parse("allow *", NULL); ceph_assert(r); @@ -3619,10 +3621,12 @@ void Monitor::handle_command(MonOpRequestRef op) mgrmon()->dispatch(op); return; } +#ifdef WITH_NVMEOF_GATEWAY_MONITOR if (module == "nvme-gw"){ nvmegwmon()->dispatch(op); return; } +#endif if (prefix == "fsid") { if (f) { f->open_object_section("fsid"); @@ -4670,9 +4674,11 @@ void Monitor::dispatch_op(MonOpRequestRef op) paxos_service[PAXOS_MGR]->dispatch(op); return; +#ifdef WITH_NVMEOF_GATEWAY_MONITOR case MSG_MNVMEOF_GW_BEACON: paxos_service[PAXOS_NVMEGW]->dispatch(op); return; +#endif // MgrStat @@ -5362,9 +5368,11 @@ void Monitor::handle_subscribe(MonOpRequestRef op) } else if (p->first.find("kv:") == 0) { kvmon()->check_sub(s->sub_map[p->first]); } +#ifdef WITH_NVMEOF_GATEWAY_MONITOR else if (p->first == "NVMeofGw") { nvmegwmon()->check_sub(s->sub_map[p->first]); } +#endif } if (reply) { diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 0f8481eea6d..ae5cf6e13ac 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -61,6 +61,9 @@ using namespace TOPNSPC::common; #define CEPH_MON_PROTOCOL 13 /* cluster internal */ +// NVMe-oF gateway monitor and HA is disabled by default upstream for now. +// see doc/nvmeof/ha.md for more details +//#define WITH_NVMEOF_GATEWAY_MONITOR enum { l_cluster_first = 555000, @@ -713,7 +716,11 @@ public: } class NVMeofGwMon *nvmegwmon() { +#ifdef WITH_NVMEOF_GATEWAY_MONITOR return (class NVMeofGwMon*) paxos_service[PAXOS_NVMEGW].get(); +#else + return nullptr; +#endif } diff --git a/src/mon/mon_types.h b/src/mon/mon_types.h index 9dd2797852d..f4e80e35019 100644 --- a/src/mon/mon_types.h +++ b/src/mon/mon_types.h @@ -36,7 +36,9 @@ enum { PAXOS_HEALTH, PAXOS_CONFIG, PAXOS_KV, +#ifdef WITH_NVMEOF_GATEWAY_MONITOR PAXOS_NVMEGW, +#endif PAXOS_NUM }; -- 2.39.5