@@ -557,61 +557,6 @@ void NVMeofGwMap::find_failover_candidate(
557557 }
558558}
559559
560- void NVMeofGwMap::handle_gw_performing_fast_reboot (const NvmeGwId &gw_id,
561- const NvmeGroupKey& group_key, bool &map_modified)
562- {
563- for (auto & state_itr: created_gws[group_key][gw_id].sm_state ) {
564- fsm_handle_gw_fast_reboot (gw_id,group_key, state_itr.first , map_modified);
565- }
566- }
567-
568- void NVMeofGwMap::fsm_handle_gw_fast_reboot (const NvmeGwId &gw_id,
569- const NvmeGroupKey& group_key, NvmeAnaGrpId grpid, bool &map_modified)
570- {
571- // GW that appears in the internal map as Available, performed reboot,
572- // need to re-apply this GW: to load proper states for all active ANA groups
573- auto & gw_state = created_gws[group_key][gw_id];
574- map_modified = true ;
575- gw_states_per_group_t state = gw_state.sm_state [grpid];
576- dout (10 ) << " GW " << gw_id << " ANA groupId: " << grpid << " state "
577- << state << dendl;
578- switch (state){
579- case gw_states_per_group_t ::GW_IDLE_STATE:
580- case gw_states_per_group_t ::GW_STANDBY_STATE:
581- case gw_states_per_group_t ::GW_ACTIVE_STATE:
582- break ;
583-
584- case gw_states_per_group_t ::GW_WAIT_FAILBACK_PREPARED:
585- {
586- // restart timeout
587- start_timer (gw_id, group_key, grpid, 3 );
588- }
589- break ;
590-
591- case gw_states_per_group_t ::GW_OWNER_WAIT_FAILBACK_PREPARED:
592- {
593- // since owner was reseted for this group, wait for the background process
594- // to choose it again
595- gw_state.standby_state (grpid);
596- }
597- break ;
598-
599- case gw_states_per_group_t ::GW_WAIT_BLOCKLIST_CMPL:
600- {
601- // restart timer
602- // The blocklist was started, need to wait for the epoch in the GW
603- start_timer (gw_id, group_key, grpid, 30 );
604- }
605- break ;
606-
607- default :
608- {
609- dout (4 ) << " Warning: GW " << gw_id << " Invalid state " << state << dendl;
610- }
611- }
612- validate_gw_map (group_key);
613- }
614-
615560void NVMeofGwMap::fsm_handle_gw_alive (
616561 const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
617562 NvmeGwMonState & gw_state, gw_states_per_group_t state,
@@ -866,11 +811,11 @@ void NVMeofGwMap::fsm_handle_to_expired(
866811 }
867812 } else if (fbp_gw_state.sm_state [grpid] ==
868813 gw_states_per_group_t ::GW_WAIT_BLOCKLIST_CMPL) {
869- dout (4 ) << " Warning: Expired GW_WAIT_FAILOVER_PREPARED timer "
814+ dout (4 ) << " Warning: Expired GW_WAIT_BLOCKLIST_CMPL timer "
870815 << " from GW, Force exit the GW " << gw_id
871816 << " ANA groupId: " << grpid << dendl;
872- fbp_gw_state. set_unavailable_state ();
873- map_modified = true ;
817+ // another Trigger for GW down (failover)
818+ process_gw_map_gw_down (gw_id, group_key, map_modified) ;
874819 }
875820 if (map_modified) validate_gw_map (group_key);
876821}
0 commit comments