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(
<< " 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 "
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;