]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
nvmeofgw: fixing GW delete issues 64245/head
authorLeonid Chernin <leonidc@il.ibm.com>
Tue, 24 Jun 2025 13:00:49 +0000 (16:00 +0300)
committerLeonid Chernin <leonidc@il.ibm.com>
Wed, 2 Jul 2025 06:17:18 +0000 (09:17 +0300)
1.fixing the issue when gw is deleted based on invalid subsystem info
2. in function track_deleting_gws: break from loop only if
  delete was really done
        3. fix published rebalance index - publish ana-group instead of
  index
        4. do not dump gw-id string after gw was removed

Fixes: https://tracker.ceph.com/issues/71896
Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
src/mon/NVMeofGwMap.cc
src/mon/NVMeofGwMon.cc

index 71d3449aaebcfabd90e521b53df8eab47b1c3421..4b3fb2c676bb8fa8e13c938e1c9468282a4323ee 100755 (executable)
@@ -321,15 +321,19 @@ void NVMeofGwMap::track_deleting_gws(const NvmeGroupKey& group_key,
   propose_pending = false;
   for (auto& itr: created_gws[group_key]) {
     auto &gw_id = itr.first;
-    if (itr.second.availability == gw_availability_t::GW_DELETING) {
+    if (subs.size() &&
+        itr.second.availability == gw_availability_t::GW_DELETING) {
       int num_ns = 0;
+      dout(4) << " to delete ? " << gw_id
+          << " subsystems size "<< subs.size() << dendl;
       if ( (num_ns = get_num_namespaces(gw_id, group_key, subs)) == 0) {
         do_delete_gw(gw_id, group_key);
         propose_pending =  true;
       }
-      dout(4) << " to delete ? " << gw_id  << " num_ns " << num_ns
-          << " subsystems size "<< subs.size() << dendl;
-      break; // handle just one GW in "Deleting" state in time.
+      dout(4)  << " num_ns " << num_ns << dendl;
+      if (propose_pending) {
+        break; // handle just one GW in "Deleting" state in time.
+      }
     }
   }
 }
index dcf154674f99dc0f2a2bbdf291a6628520cc7d66..3a18c4195c0b8c13637423784d053b320364e020 100644 (file)
@@ -426,8 +426,10 @@ bool NVMeofGwMon::preprocess_command(MonOpRequestRef op)
       if (map.created_gws[group_key].size()) {
         time_t seconds_since_1970 = time(NULL);
         uint32_t index = ((seconds_since_1970/60) %
-             map.created_gws[group_key].size()) + 1;
-        f->dump_unsigned("rebalance_ana_group", index);
+             map.created_gws[group_key].size());
+        auto it = map.created_gws[group_key].begin();
+        std::advance(it, index);
+        f->dump_unsigned("rebalance_ana_group", it->second.ana_grp_id + 1);
       }
     }
     f->dump_unsigned("num gws", map.created_gws[group_key].size());