]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
fix upgrade
authorLeonid Chernin <leonidc@il.ibm.com>
Sun, 1 Mar 2026 15:43:01 +0000 (17:43 +0200)
committerLeonid Chernin <leonidc@il.ibm.com>
Wed, 29 Apr 2026 13:33:51 +0000 (16:33 +0300)
 remove invalid code from NVMeofGwSerialize.h
 put encode/decode at the file NVmeofGwMap.h

Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
(cherry picked from commit c319e6a2770f06165a18ffc9170de80f1c6d1967)

src/mon/NVMeofGwMap.cc
src/mon/NVMeofGwMap.h
src/mon/NVMeofGwSerialize.h

index bb529b1e9469cd07ac52248b1594db7e22931a40..f5ca2aaa653a9cfb4583c5303883386d7c768ffd 100755 (executable)
@@ -29,45 +29,6 @@ using std::string;
 #undef dout_prefix
 #define dout_prefix *_dout << "nvmeofgw " << __PRETTY_FUNCTION__ << " "
 
-void  NVMeofGwMap::encode(ceph::buffer::list &bl, uint64_t features) const {
-    using ceph::encode;
-    uint8_t version = 1;
-    if (HAVE_FEATURE(features, NVMEOFHAMAP)) {
-      version = 2;
-    }
-    if (HAVE_FEATURE(features, NVMEOF_BEACON_DIFF)) {
-      version = 3;
-    }
-    ENCODE_START(version, version, bl);
-    encode(epoch, bl);// global map epoch
-
-    encode(created_gws, bl, features); //Encode created GWs
-    encode(fsm_timers, bl, features);
-    if (version >= 2) {
-      encode(gw_epoch, bl);
-    }
-    if (version >=3) {
-      encode(disaster_locations, bl);
-    }
-    ENCODE_FINISH(bl);
-  }
-
-  void  NVMeofGwMap::decode(ceph::buffer::list::const_iterator &bl) {
-    using ceph::decode;
-    DECODE_START(3, bl);
-
-    decode(epoch, bl);
-    decode(created_gws, bl);
-    decode(fsm_timers, bl);
-    if (struct_v >= 2) {
-      decode(gw_epoch, bl);
-    }
-    if (struct_v >=3) {
-      decode(disaster_locations, bl);
-    }
-    DECODE_FINISH(bl);
-  }
-
 void NVMeofGwMap::to_gmap(
   std::map<NvmeGroupKey, NvmeGwMonClientStates>& Gmap) const
 {
index e712c46a99a76916b625d45c82d6847697b6ef27..f5af47d8ac53e5ae4ada63cb44726927e418421c 100755 (executable)
 #include "NVMeofGwTypes.h"
 
 using ceph::coarse_mono_clock;
-
+#define dout_context g_ceph_context
+#define dout_subsys ceph_subsys_mon
+#undef dout_prefix
+#define MODULE_PREFFIX "nvmeofgw "
+#define dout_prefix *_dout << MODULE_PREFFIX << __PRETTY_FUNCTION__ << " "
 class health_check_map_t;
 
 class Monitor;
@@ -186,9 +190,50 @@ public:
     const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
     NvmeAnaGrpId ANA_groupid, epoch_t &epoch, bool failover);
 
-  void encode(ceph::buffer::list &bl, uint64_t features) const ;
+  void encode(ceph::buffer::list &bl, uint64_t features) const  {
+    using ceph::encode;
+    uint8_t version = 1;
+    if (HAVE_FEATURE(features, NVMEOFHAMAP)) {
+      version = 2;
+    }
+    if (HAVE_FEATURE(features, NVMEOF_BEACON_DIFF)) {
+      version = 3;
+    }
+    ENCODE_START(version, version, bl);
+    encode(epoch, bl);// global map epoch
+
+    encode(created_gws, bl, features); //Encode created GWs
+    encode(fsm_timers, bl, features);
+    if (version >= 2) {
+      encode(gw_epoch, bl);
+    }
+    if (version >=3) {
+      encode(disaster_locations, bl);
+    }
+    ENCODE_FINISH(bl);
+  }
+
+  void  decode(ceph::buffer::list::const_iterator &bl) {
+    using ceph::decode;
+    DECODE_START(3, bl);
+
+    decode(epoch, bl);
+    dout(20)  << "decode epoch "  << dendl;
+    decode(created_gws, bl);
+    dout(20)  << "decode created gws "  << dendl;
+    decode(fsm_timers, bl);
+    dout(20)  << "decode fsm timers "  << dendl;
+    if (struct_v >= 2) {
+      decode(gw_epoch, bl);
+      dout(20)  << "decode gw epoch "  << dendl;
+    }
+    if (struct_v >=3) {
+      decode(disaster_locations, bl);
+      dout(20)  << "decode  disaster location "  << dendl;
+    }
+    DECODE_FINISH(bl);
+  }
 
-  void decode(ceph::buffer::list::const_iterator &bl);
   void get_health_checks(health_check_map_t *checks);
 };
 
index 7f5d1df55898b9bcc49346446ccad29c19a88af9..24dee67d70bb184ab04828d7dcbb7e2c9c6d7c5f 100755 (executable)
@@ -909,14 +909,6 @@ inline void encode(const BeaconSubsystem& sub,  ceph::bufferlist &bl, uint64_t f
   if (HAVE_FEATURE(features, NVMEOF_BEACON_DIFF)) {
     version = 2;
   }
-  // For legacy encoding, skip deleted subsystems to maintain compatibility
-  if (version == 1 &&
-      sub.change_descriptor != subsystem_change_t::SUBSYSTEM_ADDED) {
-    dout(4) << "encode BeaconSubsystem: skipping subsystem " << sub.nqn
-            << " with change_descriptor " << (int)sub.change_descriptor
-            << " in legacy mode" << dendl;
-    return; // Skip encoding this subsystem entirely
-  }
 
   ENCODE_START(version, version, bl);
   encode(sub.nqn, bl);
@@ -942,6 +934,7 @@ inline void decode(BeaconSubsystem& sub, ceph::buffer::list::const_iterator &bl)
   uint32_t s;
   sub.listeners.clear();
   decode(s, bl);
+  dout(20) << "decode Nlisteners " << s << dendl;
   for (uint32_t i = 0; i < s; i++) {
     BeaconListener ls;
     decode(ls, bl);