]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
nvmeofgw:fix forcing unavailable gw exit by sending 68650/head
authorLeonid Chernin <leonidc@il.ibm.com>
Fri, 10 Apr 2026 08:15:20 +0000 (11:15 +0300)
committerLeonid Chernin <leonidc@il.ibm.com>
Mon, 25 May 2026 06:48:09 +0000 (09:48 +0300)
         empty map to it

Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
src/mon/NVMeofGwMap.cc
src/mon/NVMeofGwMon.cc

index 6cf45bcd7bfd8645649a1388d34d899d726491dc..e7eb42c91b4d1dbe0e4c814d16f9bcf5e850ec07 100644 (file)
@@ -43,10 +43,11 @@ void NVMeofGwMap::to_gmap(
       const auto& gw_id = gw_created_pair.first;
       const auto& gw_created  = gw_created_pair.second;
       gw_availability_t availability = gw_created.availability;
-      if (gw_created.availability == gw_availability_t::GW_DELETING) {
-         dout (4) << gw_id << "Send empty unicast map in Deleting state"
-                  << dendl;
-         continue;
+      if (gw_created.availability == gw_availability_t::GW_DELETING ||
+          gw_created.availability == gw_availability_t::GW_UNAVAILABLE) {
+        dout (4) << "GW " << gw_id << " Send empty unicast map in state "
+                 << gw_created.availability << dendl;
+        continue;
       }
 
       auto gw_state = NvmeGwClientState(
index fe8bf32318b3baf19dc50584deb3383d9ae0fe8e..8635da1c5e7be0accef27ee606010d8483cccdc1 100644 (file)
@@ -1116,6 +1116,11 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op)
               << " GW state in monitor data-base : "
               << pending_map.created_gws[group_key][gw_id].availability
               << dendl;
+      if (pending_map.created_gws[group_key][gw_id].availability ==
+          gw_availability_t::GW_UNAVAILABLE) {
+        pending_map.created_gws[group_key][gw_id].availability =
+          gw_availability_t::GW_CREATED; // prevent sending empty map to this GW after restart
+      }
       if (pending_map.created_gws[group_key][gw_id].availability ==
          gw_availability_t::GW_AVAILABLE) {
        dout(1) << " Warning :GW marked as Available in the NVmeofGwMon "
@@ -1150,11 +1155,9 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op)
           false) &&
          (avail == gw_availability_t::GW_AVAILABLE ||
           avail == gw_availability_t::GW_UNAVAILABLE )) {
-       ack_map.created_gws[group_key][gw_id] =
-         pending_map.created_gws[group_key][gw_id];
        ack_map.epoch = get_ack_map_epoch(true, group_key);
-       dout(1) << " Force gw to exit: first beacon in state " << avail
-               << " GW " << gw_id << dendl;
+       dout(1) << "Send empty map. Force gw to exit: first beacon in state "
+               << avail << " GW " << gw_id << dendl;
        auto msg = make_message<MNVMeofGwMap>(ack_map);
        mon.send_reply(op, msg.detach());
        goto false_return;