From: Leonid Chernin Date: Wed, 3 Jun 2026 18:51:39 +0000 (+0300) Subject: nvmeofgw: arm beacon timeouts for GWs in Created state X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d5e254c6313d3d7bf15b7845fd546d47a29f5ae9;p=ceph.git nvmeofgw: arm beacon timeouts for GWs in Created state Signed-off-by: Leonid Chernin --- diff --git a/src/mon/NVMeofGwMap.cc b/src/mon/NVMeofGwMap.cc index b72dc3e898b..42b6ada448a 100644 --- a/src/mon/NVMeofGwMap.cc +++ b/src/mon/NVMeofGwMap.cc @@ -651,15 +651,28 @@ void NVMeofGwMap::skip_failovers_for_group(const NvmeGroupKey& group_key, } } -int NVMeofGwMap::process_gw_map_gw_no_subsys_no_listeners( +/* + This function called in the following cases: + - Gw has no subsystems and no listeners + - GW performed fast startup + - GW sends the beacon with a wrong sequence number + - GW starts in ADMIN_DISABLED state + In all cases when GW passes to CREATED state it should not have active ANA groups + No failover started in all these cases, GW stay alive and beacon timer is armed +*/ +int NVMeofGwMap::process_gw_map_gw_pass_to_created( const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool &propose_pending) { int rc = 0; auto& gws_states = created_gws[group_key]; auto gw_state = gws_states.find(gw_id); if (gw_state != gws_states.end()) { - dout(10) << "GW- no subsystems configured " << gw_id << dendl; + dout(10) << "GW-id no subsystems configured " << gw_id << dendl; auto& st = gw_state->second; + if (st.availability == gw_availability_t::GW_CREATED) { + dout(20) << "GW-id was already in Created state " <get_last_osd_epoch(); pending_map.process_gw_map_ka(gw_id, group_key, last_osd_epoch, gw_propose); // state set by GW client application - } else if (avail == gw_availability_t::GW_UNAVAILABLE || - avail == gw_availability_t::GW_CREATED) { - process_gw_down(gw_id, group_key, gw_propose, avail); + } else if (avail == gw_availability_t::GW_UNAVAILABLE) { + process_gw_down(gw_id, group_key, gw_propose); + } else if (avail == gw_availability_t::GW_CREATED) { + LastBeacon lb = {gw_id, group_key}; + last_beacon[lb] = now; + pending_map.process_gw_map_gw_pass_to_created + (gw_id, group_key, gw_propose); } // Periodic: check active FSM timers pending_map.update_active_timers(timer_propose); diff --git a/src/mon/NVMeofGwMon.h b/src/mon/NVMeofGwMon.h index 17f92ab2bfe..1a22f64f608 100644 --- a/src/mon/NVMeofGwMon.h +++ b/src/mon/NVMeofGwMon.h @@ -95,8 +95,7 @@ public: private: void synchronize_last_beacon(); void process_gw_down(const NvmeGwId &gw_id, - const NvmeGroupKey& group_key, bool &propose_pending, - gw_availability_t avail); + const NvmeGroupKey& group_key, bool &propose_pending); bool get_gw_by_addr(const entity_addr_t &sub_addr, NvmeGwId &gw_id, NvmeGroupKey& group_key); epoch_t get_ack_map_epoch(bool gw_created, const NvmeGroupKey& group_key);