From: Leonid Chernin Date: Wed, 22 Jan 2025 18:04:47 +0000 (+0200) Subject: nvmeofgw*: MonClient should send a first beacon with CREATED state X-Git-Tag: v20.0.0~51^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=438fdd5750c3f8749955346666094e1f32c1fd91;p=ceph.git nvmeofgw*: MonClient should send a first beacon with CREATED state Signed-off-by: Leonid Chernin --- diff --git a/src/nvmeof/NVMeofGwMonitorClient.cc b/src/nvmeof/NVMeofGwMonitorClient.cc index 0aa1b4b81a58..967ffc597111 100644 --- a/src/nvmeof/NVMeofGwMonitorClient.cc +++ b/src/nvmeof/NVMeofGwMonitorClient.cc @@ -245,7 +245,7 @@ void NVMeofGwMonitorClient::send_beacon() auto group_key = std::make_pair(pool, group); NvmeGwClientState old_gw_state; // if already got gateway state in the map - if (get_gw_state("old map", map, group_key, name, old_gw_state)) + if (first_beacon == false && get_gw_state("old map", map, group_key, name, old_gw_state)) gw_availability = ok ? gw_availability_t::GW_AVAILABLE : gw_availability_t::GW_UNAVAILABLE; dout(10) << "sending beacon as gid " << monc.get_global_id() << " availability " << (int)gw_availability << " osdmap_epoch " << osdmap_epoch << " gwmap_epoch " << gwmap_epoch << dendl; @@ -277,7 +277,7 @@ void NVMeofGwMonitorClient::tick() disconnect_panic(); send_beacon(); - + first_beacon = false; timer.add_event_after( g_conf().get_val("nvmeof_mon_client_tick_period").count(), new LambdaContext([this](int r){ diff --git a/src/nvmeof/NVMeofGwMonitorClient.h b/src/nvmeof/NVMeofGwMonitorClient.h index e01c823afb51..cfe1b8971f0b 100644 --- a/src/nvmeof/NVMeofGwMonitorClient.h +++ b/src/nvmeof/NVMeofGwMonitorClient.h @@ -45,7 +45,7 @@ private: epoch_t gwmap_epoch; // last received gw map epoch std::chrono::time_point last_map_time; // used to panic on disconnect - + bool first_beacon = true; // init gw ssl opts void init_gw_ssl_opts();