return -EINVAL;
}
+void NVMeofGwMap::check_all_gws_in_deleting_state(const NvmeGwId &gw_id,
+ const NvmeGroupKey& group_key) {
+ for (auto& gws_states: created_gws[group_key]) {
+ auto& state = gws_states.second;
+ if (state.availability != gw_availability_t::GW_DELETING) {
+ return;
+ }
+ }
+ dout(5) << "all gws in DELETING state, remove them from the map: pool/group "
+ << group_key << dendl;
+ /* Monitor have to force remove GWs because otherwise all GW will stay forever
+ * in DELETING state - no beacons from the group and monitor cannot update
+ * number namespaces in each group so delete condition newer turns true.
+ */
+ for (auto& gws_states: created_gws[group_key]) {
+ do_delete_gw(gws_states.first, group_key);
+ }
+ return;
+}
+
int NVMeofGwMap::do_erase_gw_id(const NvmeGwId &gw_id,
const NvmeGroupKey& group_key) {
const BeaconSubsystems& subs, bool &propose_pending);
int cfg_add_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key);
int cfg_delete_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key);
+ void check_all_gws_in_deleting_state(const NvmeGwId &gw_id,
+ const NvmeGroupKey& group_key);
void process_gw_map_ka(
const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
epoch_t& last_osd_epoch, bool &propose_pending);
// Simulate immediate Failover of this GW
process_gw_down(id, group_key, propose,
gw_availability_t::GW_UNAVAILABLE);
+ pending_map.check_all_gws_in_deleting_state(id, group_key);
} else if (rc == -EINVAL) {
dout (4) << "Error: GW not found in the database " << id << " "
<< pool << " " << group << " rc " << rc << dendl;