]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Force failover for GW that performed full startup in Available state
authorLeonid Chernin <leonidc@il.ibm.com>
Thu, 16 May 2024 15:54:56 +0000 (15:54 +0000)
committerAlexander Indenbaum <aindenba@redhat.com>
Thu, 20 Nov 2025 08:55:27 +0000 (10:55 +0200)
Resolves: rhbz#2281471

Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
(cherry picked from commit 149e13f8da960f3f96d2267596cea821e0e3ebe4)
Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
src/mon/NVMeofGwMon.cc

index 97bff620f77ce66e0b24236ce35f547c1fc54f20..b26d6af2cfb90397bd4e36733a9f8d32c27f0b3d 100644 (file)
@@ -429,15 +429,21 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op){
         if (gw == group_gws.end()) {
            gw_created = false;
            dout(10) << "Warning: GW " << gw_id << " group_key " << group_key << " was not found in the  map.Created_gws "<< map.Created_gws <<dendl;
+           goto set_propose;
         }
         else {
-            dout(4) << "GW  prepares the full startup " << gw_id << dendl;
-            if(pending_map.Created_gws[group_key][gw_id].performed_full_startup == false){
+            dout(4) << "GW  prepares the full startup " << gw_id << " GW availability: " << pending_map.Created_gws[group_key][gw_id].availability << dendl;
+            if(pending_map.Created_gws[group_key][gw_id].availability == GW_AVAILABILITY_E::GW_AVAILABLE){
+                dout(4) << "GW marked as Available in the NVmeofGwMon database, performed full startup - Force gw to exit!" << gw_id <<dendl;
+                avail = GW_AVAILABILITY_E::GW_UNAVAILABLE;
+                // Monitor performs Force Failover for this GW in process_gw_map_gw_down
+            }
+            else if(pending_map.Created_gws[group_key][gw_id].performed_full_startup == false){
                 pending_map.Created_gws[group_key][gw_id].performed_full_startup = true;
                 propose = true;
+                goto set_propose;
             }
         }
-        goto set_propose;
     }
     else { // gw already created
         if (gw != group_gws.end()) // if GW reports Available but in monitor's database it is Unavailable