]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
nvmeofgw*: 2 fixes - for duplicated optimized pathes and fix for GW startup 61538/head
authorLeonid Chernin <leonidc@il.ibm.com>
Tue, 21 Jan 2025 13:05:09 +0000 (13:05 +0000)
committerLeonid Chernin <leonidc@il.ibm.com>
Tue, 28 Jan 2025 19:28:09 +0000 (19:28 +0000)
 1. fix duplicated optimized host's pathes - trigger process_gw_down upon
   fast-gw reboot, removed old fast-reboot handlers
 2. fix GW startup - trigger process_gw_down when expired WAIT_BLOCKLIST timer

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

index 2d2735f1e7c2e9893459314e4def8083ba7c202f..26c16740ecbad3c33ebb2235a6dc81e319e54965 100755 (executable)
@@ -557,61 +557,6 @@ void  NVMeofGwMap::find_failover_candidate(
   }
 }
 
-void  NVMeofGwMap::handle_gw_performing_fast_reboot(const NvmeGwId &gw_id,
-     const NvmeGroupKey& group_key, bool &map_modified)
-{
-  for (auto& state_itr: created_gws[group_key][gw_id].sm_state ) {
-    fsm_handle_gw_fast_reboot(gw_id,group_key, state_itr.first, map_modified);
-  }
-}
-
-void NVMeofGwMap::fsm_handle_gw_fast_reboot(const NvmeGwId &gw_id,
-    const NvmeGroupKey& group_key, NvmeAnaGrpId grpid, bool &map_modified)
-{
-  // GW that appears in the internal map as Available, performed reboot,
-  // need to re-apply this GW: to load proper states for all active ANA groups
-  auto& gw_state = created_gws[group_key][gw_id];
-  map_modified = true;
-  gw_states_per_group_t  state = gw_state.sm_state[grpid];
-  dout(10) << "GW " << gw_id  << " ANA groupId: " << grpid << " state "
-        << state << dendl;
-  switch (state){
-  case gw_states_per_group_t::GW_IDLE_STATE:
-  case gw_states_per_group_t::GW_STANDBY_STATE:
-  case gw_states_per_group_t::GW_ACTIVE_STATE:
-    break;
-
-  case gw_states_per_group_t::GW_WAIT_FAILBACK_PREPARED:
-  {
-    //restart timeout
-    start_timer(gw_id, group_key, grpid, 3);
-  }
-  break;
-
-  case gw_states_per_group_t::GW_OWNER_WAIT_FAILBACK_PREPARED:
-  {
-    // since owner was reseted for this group, wait for the background process
-    // to choose it again
-    gw_state.standby_state(grpid);
-  }
-  break;
-
-  case gw_states_per_group_t::GW_WAIT_BLOCKLIST_CMPL:
-  {
-    //restart timer
-    // The blocklist was started, need to wait for the epoch in the GW
-    start_timer(gw_id, group_key, grpid, 30);
-  }
-  break;
-
-  default:
-  {
-    dout(4) << "Warning: GW " << gw_id  << " Invalid state " << state << dendl;
-  }
-  }
-  validate_gw_map(group_key);
-}
-
 void NVMeofGwMap::fsm_handle_gw_alive(
   const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
   NvmeGwMonState & gw_state, gw_states_per_group_t state,
@@ -866,11 +811,11 @@ void NVMeofGwMap::fsm_handle_to_expired(
     }
   } else if (fbp_gw_state.sm_state[grpid] ==
             gw_states_per_group_t::GW_WAIT_BLOCKLIST_CMPL) {
-    dout(4) << "Warning: Expired GW_WAIT_FAILOVER_PREPARED timer "
+    dout(4) << "Warning: Expired GW_WAIT_BLOCKLIST_CMPL timer "
            << "from GW, Force exit the GW " << gw_id
            << " ANA groupId: "<< grpid << dendl;
-    fbp_gw_state.set_unavailable_state();
-    map_modified = true;
+    //another Trigger for GW down (failover)
+    process_gw_map_gw_down(gw_id, group_key, map_modified);
   }
   if (map_modified) validate_gw_map(group_key);
 }
index 85fd62b3a07d8e09a98e6d620e8a1f2709affd18..2fd38346869891011ea9a5623b0bc3cc0bbddaa9 100755 (executable)
@@ -96,9 +96,6 @@ private:
   void fsm_handle_to_expired(
     const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
     NvmeAnaGrpId grpid,  bool &map_modified);
-  void fsm_handle_gw_fast_reboot(const NvmeGwId &gw_id,
-      const NvmeGroupKey& group_key, NvmeAnaGrpId grpid,
-      bool &map_modified);
   void find_failover_candidate(
     const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
     NvmeAnaGrpId grpid, bool &propose_pending);
index c9a6b789b8940d3df58a2e16c44d505df7cfe506..0d735a5145ca3143ebd3b6f1832d8616ac835e53 100644 (file)
@@ -553,7 +553,7 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op)
        dout(4) << " Warning :GW marked as Available in the NVmeofGwMon "
                << "database, performed full startup - Apply GW!"
                << gw_id << dendl;
-        pending_map.handle_gw_performing_fast_reboot(gw_id, group_key, propose);
+        process_gw_down(gw_id, group_key, propose, avail);
         LastBeacon lb = {gw_id, group_key};
         last_beacon[lb] = now; //Update last beacon
       } else if (