]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Revert "mon/nvmeofgw*: fix HA usecase when gateway has no listeners -"
authorLeonid Chernin <leonidc@il.ibm.com>
Sun, 20 Oct 2024 06:41:12 +0000 (09:41 +0300)
committerAlexander Indenbaum <aindenba@redhat.com>
Wed, 19 Nov 2025 18:41:52 +0000 (20:41 +0200)
Temporary revert since it causes host issues
This reverts commit 4e8c7cd7f441e7253e188f3479869afc146689cb.

Resolves: rhbz#2319963

src/mon/NVMeofGwMap.cc
src/mon/NVMeofGwMap.h
src/mon/NVMeofGwMon.cc

index ac62acb2202ec60f23914ad04e9aa28319a8e5c8..068258289af81da8d8167591fced8e912be70708 100755 (executable)
@@ -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;
index 267d85b10f9184435b3d849a30db17af64ff3fe3..29710371742185d4b432f42c6f93ba73af41bbba 100755 (executable)
@@ -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);
index d9e936e27df34a8f292b7c711062b2fa1b19beb8..734e90defd946223008a241b071c1a157389ed6a 100644 (file)
@@ -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;