From: Leonid Chernin Date: Sun, 20 Oct 2024 06:41:12 +0000 (+0300) Subject: Revert "mon/nvmeofgw*: fix HA usecase when gateway has no listeners -" X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7687f9376f549c658352a30a0e0bdb62de108e39;p=ceph-ci.git Revert "mon/nvmeofgw*: fix HA usecase when gateway has no listeners -" Temporary revert since it causes host issues This reverts commit 4e8c7cd7f441e7253e188f3479869afc146689cb. Resolves: rhbz#2319963 --- diff --git a/src/mon/NVMeofGwMap.cc b/src/mon/NVMeofGwMap.cc index ac62acb2202..068258289af 100755 --- a/src/mon/NVMeofGwMap.cc +++ b/src/mon/NVMeofGwMap.cc @@ -252,7 +252,7 @@ void NVMeofGwMap::track_deleting_gws(const NvmeGroupKey& group_key, } } -int NVMeofGwMap::process_gw_map_gw_no_subsys_no_listeners( +int NVMeofGwMap::process_gw_map_gw_no_subsystems( const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool &propose_pending) { int rc = 0; @@ -422,6 +422,7 @@ void NVMeofGwMap::find_failback_gw( auto& gws_states = created_gws[group_key]; auto& gw_state = created_gws[group_key][gw_id]; bool do_failback = false; + dout(10) << "Find failback GW for GW " << gw_id << dendl; for (auto& gw_state_it: gws_states) { auto& st = gw_state_it.second; diff --git a/src/mon/NVMeofGwMap.h b/src/mon/NVMeofGwMap.h index 267d85b10f9..29710371742 100755 --- a/src/mon/NVMeofGwMap.h +++ b/src/mon/NVMeofGwMap.h @@ -54,7 +54,7 @@ public: int process_gw_map_gw_down( const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool &propose_pending); - int process_gw_map_gw_no_subsys_no_listeners( + int process_gw_map_gw_no_subsystems( const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool &propose_pending); void update_active_timers(bool &propose_pending); diff --git a/src/mon/NVMeofGwMon.cc b/src/mon/NVMeofGwMon.cc index d9e936e27df..734e90defd9 100644 --- a/src/mon/NVMeofGwMon.cc +++ b/src/mon/NVMeofGwMon.cc @@ -367,13 +367,6 @@ bool NVMeofGwMon::preprocess_command(MonOpRequestRef op) std::stringstream sstrm1; sstrm1 << state.availability; f->dump_string("Availability", sstrm1.str()); - uint32_t num_listeners = 0; - if (state.availability == gw_availability_t::GW_AVAILABLE) { - for (auto &subs: state.subsystems) { - num_listeners += subs.listeners.size(); - } - f->dump_unsigned("num-listeners", num_listeners); - } sstrm1.str(""); for (auto &state_itr: map.created_gws[group_key][gw_id].sm_state) { sstrm1 << " " << state_itr.first + 1 << ": " @@ -483,7 +476,7 @@ void NVMeofGwMon::process_gw_down(const NvmeGwId &gw_id, if (avail == gw_availability_t::GW_UNAVAILABLE) { pending_map.process_gw_map_gw_down(gw_id, group_key, propose_pending); } else { - pending_map.process_gw_map_gw_no_subsys_no_listeners(gw_id, group_key, propose_pending); + pending_map.process_gw_map_gw_no_subsystems(gw_id, group_key, propose_pending); } } @@ -607,18 +600,7 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op) if (sub.size() == 0) { avail = gw_availability_t::GW_CREATED; - } else { - bool listener_found = false; - for (auto &subs: sub) { - if (subs.listeners.size()) { - listener_found = true; - break; - } - } - if (!listener_found) { - avail = gw_availability_t::GW_CREATED; - } - }// for HA no-subsystems and no-listeners are same usecases + } if (pending_map.created_gws[group_key][gw_id].subsystems != sub) { dout(10) << "subsystems of GW changed, propose pending " << gw_id << dendl; pending_map.created_gws[group_key][gw_id].subsystems = sub;