Skip to content

Commit 6911df2

Browse files
author
Alexander Indenbaum
committed
nvmeof gw monitor: disable by default
Signed-off-by: Alexander Indenbaum <[email protected]>
1 parent d0c4182 commit 6911df2

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/mon/Monitor.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ Monitor::Monitor(CephContext* cct_, string nm, MonitorDBStore *s,
248248
paxos_service[PAXOS_HEALTH].reset(new HealthMonitor(*this, *paxos, "health"));
249249
paxos_service[PAXOS_CONFIG].reset(new ConfigMonitor(*this, *paxos, "config"));
250250
paxos_service[PAXOS_KV].reset(new KVMonitor(*this, *paxos, "kv"));
251+
#ifdef WITH_NVMEOF_GATEWAY_MONITOR
251252
paxos_service[PAXOS_NVMEGW].reset(new NVMeofGwMon(*this, *paxos, "nvmeofgw"));
253+
#endif
252254

253255
bool r = mon_caps.parse("allow *", NULL);
254256
ceph_assert(r);
@@ -3619,10 +3621,12 @@ void Monitor::handle_command(MonOpRequestRef op)
36193621
mgrmon()->dispatch(op);
36203622
return;
36213623
}
3624+
#ifdef WITH_NVMEOF_GATEWAY_MONITOR
36223625
if (module == "nvme-gw"){
36233626
nvmegwmon()->dispatch(op);
36243627
return;
36253628
}
3629+
#endif
36263630
if (prefix == "fsid") {
36273631
if (f) {
36283632
f->open_object_section("fsid");
@@ -4670,9 +4674,11 @@ void Monitor::dispatch_op(MonOpRequestRef op)
46704674
paxos_service[PAXOS_MGR]->dispatch(op);
46714675
return;
46724676

4677+
#ifdef WITH_NVMEOF_GATEWAY_MONITOR
46734678
case MSG_MNVMEOF_GW_BEACON:
46744679
paxos_service[PAXOS_NVMEGW]->dispatch(op);
46754680
return;
4681+
#endif
46764682

46774683

46784684
// MgrStat
@@ -5362,9 +5368,11 @@ void Monitor::handle_subscribe(MonOpRequestRef op)
53625368
} else if (p->first.find("kv:") == 0) {
53635369
kvmon()->check_sub(s->sub_map[p->first]);
53645370
}
5371+
#ifdef WITH_NVMEOF_GATEWAY_MONITOR
53655372
else if (p->first == "NVMeofGw") {
53665373
nvmegwmon()->check_sub(s->sub_map[p->first]);
53675374
}
5375+
#endif
53685376
}
53695377

53705378
if (reply) {

src/mon/Monitor.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ using namespace TOPNSPC::common;
6161

6262
#define CEPH_MON_PROTOCOL 13 /* cluster internal */
6363

64+
// NVMe-oF gateway monitor and HA is disabled by default upstream for now.
65+
// see doc/nvmeof/ha.md for more details
66+
//#define WITH_NVMEOF_GATEWAY_MONITOR
6467

6568
enum {
6669
l_cluster_first = 555000,
@@ -713,7 +716,11 @@ class Monitor : public Dispatcher,
713716
}
714717

715718
class NVMeofGwMon *nvmegwmon() {
719+
#ifdef WITH_NVMEOF_GATEWAY_MONITOR
716720
return (class NVMeofGwMon*) paxos_service[PAXOS_NVMEGW].get();
721+
#else
722+
return nullptr;
723+
#endif
717724
}
718725

719726

src/mon/mon_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ enum {
3636
PAXOS_HEALTH,
3737
PAXOS_CONFIG,
3838
PAXOS_KV,
39+
#ifdef WITH_NVMEOF_GATEWAY_MONITOR
3940
PAXOS_NVMEGW,
41+
#endif
4042
PAXOS_NUM
4143
};
4244

0 commit comments

Comments
 (0)