]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
nvmeofgw*: MonClient should send a first beacon with CREATED state
authorLeonid Chernin <leonidc@il.ibm.com>
Wed, 22 Jan 2025 18:04:47 +0000 (20:04 +0200)
committerleonidc <leonidc@il.ibm.com>
Sun, 16 Feb 2025 19:57:09 +0000 (21:57 +0200)
Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
src/nvmeof/NVMeofGwMonitorClient.cc
src/nvmeof/NVMeofGwMonitorClient.h

index 0aa1b4b81a58e021dcc99e7d37f1cc2efad5050b..967ffc59711173ceea34771bb0c35c48cd9d4d0d 100644 (file)
@@ -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<std::chrono::seconds>("nvmeof_mon_client_tick_period").count(),
       new LambdaContext([this](int r){
index e01c823afb51aae7083915984170d9ed53bd5763..cfe1b8971f0bbde86c266728330ef685c8bb3328 100644 (file)
@@ -45,7 +45,7 @@ private:
   epoch_t     gwmap_epoch;  // last received gw map epoch
   std::chrono::time_point<std::chrono::steady_clock>
               last_map_time; // used to panic on disconnect
-
+  bool first_beacon = true;
   // init gw ssl opts
   void init_gw_ssl_opts();