Skip to content

Commit 79e1504

Browse files
authored
Merge pull request ceph#61538 from leonidc/fix-duplicated-optimized
nvmeofgw* : fix duplicated optimized host's pathes
2 parents 409818f + 4397c02 commit 79e1504

File tree

3 files changed

+4
-62
lines changed

3 files changed

+4
-62
lines changed

src/mon/NVMeofGwMap.cc

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
615560
void 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
}

src/mon/NVMeofGwMap.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ class NVMeofGwMap
9696
void fsm_handle_to_expired(
9797
const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
9898
NvmeAnaGrpId grpid, bool &map_modified);
99-
void fsm_handle_gw_fast_reboot(const NvmeGwId &gw_id,
100-
const NvmeGroupKey& group_key, NvmeAnaGrpId grpid,
101-
bool &map_modified);
10299
void find_failover_candidate(
103100
const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
104101
NvmeAnaGrpId grpid, bool &propose_pending);

src/mon/NVMeofGwMon.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op)
553553
dout(1) << " Warning :GW marked as Available in the NVmeofGwMon "
554554
<< "database, performed full startup - Apply GW!"
555555
<< gw_id << dendl;
556-
pending_map.handle_gw_performing_fast_reboot(gw_id, group_key, propose);
556+
process_gw_down(gw_id, group_key, propose, avail);
557557
LastBeacon lb = {gw_id, group_key};
558558
last_beacon[lb] = now; //Update last beacon
559559
} else if (

0 commit comments

Comments
 (0)