]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
nvmeofgw : beacon-diff cr changes 2
authorLeonid Chernin <leonidc@il.ibm.com>
Tue, 21 Oct 2025 07:00:50 +0000 (10:00 +0300)
committerLeonid Chernin <leonidc@il.ibm.com>
Sun, 2 Nov 2025 07:49:17 +0000 (09:49 +0200)
Signed-off-by: Leonid Chernin <leonidc@il.ibm.com>
src/include/ceph_features.h
src/messages/MNVMeofGwBeacon.h
src/mon/NVMeofGwMap.cc
src/mon/NVMeofGwMap.h
src/mon/NVMeofGwMon.cc
src/mon/NVMeofGwSerialize.h
src/test/test_nvmeof_mon_encoding.cc

index b9ca2690abef3333b9cf8a6c0b5d9ea98736819b..9e51419e643d3af307626b8bfff87f468d794988 100644 (file)
@@ -162,7 +162,6 @@ DEFINE_CEPH_FEATURE_RETIRED(49, 1, OSD_PROXY_FEATURES, JEWEL, LUMINOUS) // overl
 DEFINE_CEPH_FEATURE(49, 2, SERVER_SQUID);
 DEFINE_CEPH_FEATURE_RETIRED(50, 1, MON_METADATA, MIMIC, OCTOPUS)
 DEFINE_CEPH_FEATURE(50, 2, SERVER_TENTACLE);
-DEFINE_CEPH_FEATURE_RETIRED(51, 1, OSD_BITWISE_HOBJ_SORT, MIMIC, OCTOPUS)
 DEFINE_CEPH_FEATURE(51, 2, NVMEOF_BEACON_DIFF)
 // available
 DEFINE_CEPH_FEATURE_RETIRED(52, 1, OSD_PROXY_WRITE_FEATURES, MIMIC, OCTOPUS)
index f18bb3cd7c8821695306d99656835bfdee82a12c..a8005658041a23f9bf076b91a33ca9917344e6d0 100644 (file)
@@ -55,7 +55,7 @@ public:
         uint64_t sequence_ = 0,  // default sequence for backward compatibility
         bool enable_diff = false)  // default to legacy behavior for backward compatibility
     : PaxosServiceMessage{MSG_MNVMEOF_GW_BEACON,
-                          static_cast<version_t>(enable_diff ? 1 : 0), // user_version: 1=enhanced, 0=legacy
+                          0,
                           enable_diff ? BEACON_VERSION_ENHANCED :
                           BEACON_VERSION_LEGACY, BEACON_VERSION_LEGACY},// Minimum compatible version
       gw_id(gw_id_), gw_pool(gw_pool_), gw_group(gw_group_), subsystems(subsystems_),
index b2202705a583431a1943a4c888003b7b6a086af6..5d1a42089e4770515c121afba88ba211ed0739e8 100755 (executable)
@@ -83,10 +83,10 @@ void NVMeofGwMap::remove_grp_id(
 }
 
 int NVMeofGwMap::cfg_add_gw(
-  const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool test)
+  const NvmeGwId &gw_id, const NvmeGroupKey& group_key, uint64_t features)
 {
   std::set<NvmeAnaGrpId> allocated;
-  if (test || HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOFHAMAP)) {
+  if (HAVE_FEATURE(features, NVMEOFHAMAP)) {
     auto gw_epoch_it = gw_epoch.find(group_key);
     if (gw_epoch_it == gw_epoch.end()) {
       gw_epoch[group_key] = epoch;
@@ -170,11 +170,8 @@ int NVMeofGwMap::cfg_add_gw(
 }
 
 int NVMeofGwMap::cfg_delete_gw(
-  const NvmeGwId &gw_id, const NvmeGroupKey& group_key, bool test)
+  const NvmeGwId &gw_id, const NvmeGroupKey& group_key)
 {
-  if (test)
-    return do_delete_gw(gw_id, group_key);
-
   if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOFHA)) {
     dout(10) << " has NVMEOFHA: 1" << dendl;
     for (auto& gws_states: created_gws[group_key]) {
index 0328b12611705e413b1ed5c553f5ec325179b702..bfc45a009854eb178d5953422197e6aa3a9b5969 100755 (executable)
@@ -68,14 +68,13 @@ public:
   void check_all_gws_in_deleting_state(const NvmeGwId &gw_id,
     const NvmeGroupKey& group_key);
   int cfg_add_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
-    bool test = false);
-  int cfg_delete_gw(const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
-    bool test = false);
+    uint64_t features);
+  int cfg_delete_gw(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);
   int process_gw_map_gw_down(
-    const NvmeGwId &gw_id, const Nv/meGroupKey& group_key,
+    const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
     bool &propose_pending);
   int process_gw_map_gw_no_subsys_no_listeners(
     const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
index 2b029f8cf24646999fbd91d69a2e14b5099a5056..1e4d5525b9df4b2c4609f88d8e384354421697c5 100644 (file)
@@ -578,7 +578,8 @@ bool NVMeofGwMon::prepare_command(MonOpRequestRef op)
     auto group_key = std::make_pair(pool, group);
     dout(10) << " id "<< id <<" pool "<< pool << " group "<< group << dendl;
     if (prefix == "nvme-gw create") {
-      rc = pending_map.cfg_add_gw(id, group_key);
+      rc = pending_map.cfg_add_gw(id, group_key,
+                  mon.get_quorum_con_features());
       if (rc == -EINVAL) {
        err = rc;
        dout (4) << "Error: GW cannot be created " << id
index 244524c299c82a40dedf5db861311256b45f7aef..f9aabeb985dec39cc76106e24aa5b74d64f428cb 100755 (executable)
@@ -337,12 +337,10 @@ inline  void decode(
   decode(state.gw_map_epoch, bl);
   decode(state.subsystems, bl);
   uint32_t avail;
-  uint64_t last_beacon_seq_number;
   decode(avail, bl);
   state.availability = (gw_availability_t)avail;
   if (struct_v >= 2) {
-    decode(last_beacon_seq_number, bl);
-    state.last_beacon_seq_number = last_beacon_seq_number;
+    decode(state.last_beacon_seq_number, bl);
     decode(state.last_beacon_seq_ooo, bl);
   }
   DECODE_FINISH(bl);
index e03df6c852ef880b8a62a687c94fa1477ded6855..9d936b8021d8dc7f6b2266042bbb6ca65a937639 100644 (file)
@@ -40,9 +40,9 @@ void test_NVMeofGwMap() {
   BeaconSubsystem sub = { nqn, {}, {}, subsystem_change_t::SUBSYSTEM_CHANGED };
   BeaconSubsystems subs = {sub};
 
-  pending_map.cfg_add_gw("GW1" ,group_key, true);
-  pending_map.cfg_add_gw("GW2" ,group_key, true);
-  pending_map.cfg_add_gw("GW3" ,group_key, true);
+  pending_map.cfg_add_gw("GW1" ,group_key, CEPH_FEATURES_ALL);
+  pending_map.cfg_add_gw("GW2" ,group_key, CEPH_FEATURES_ALL);
+  pending_map.cfg_add_gw("GW3" ,group_key, CEPH_FEATURES_ALL);
   NvmeNonceVector new_nonces = {"abc", "def","hij"};
   pending_map.created_gws[group_key]["GW1"].nonce_map[1] = new_nonces;
   pending_map.created_gws[group_key]["GW1"].performed_full_startup = true;
@@ -104,9 +104,9 @@ void test_MNVMeofGwMap() {
   int epoch = msg1->get_gwmap_epoch();
   dout(0) << "after decode empty msg: " << *msg1 << " epoch " << epoch <<  dendl;
 
-  pending_map.cfg_add_gw("GW1" ,group_key, true);
-  pending_map.cfg_add_gw("GW2" ,group_key, true);
-  pending_map.cfg_add_gw("GW3" ,group_key, true);
+  pending_map.cfg_add_gw("GW1" ,group_key, CEPH_FEATURES_ALL);
+  pending_map.cfg_add_gw("GW2" ,group_key, CEPH_FEATURES_ALL);
+  pending_map.cfg_add_gw("GW3" ,group_key, CEPH_FEATURES_ALL);
   NvmeNonceVector new_nonces = {"abc", "def","hij"};
   pending_map.created_gws[group_key]["GW1"].nonce_map[1] = new_nonces;
   pending_map.created_gws[group_key]["GW1"].subsystems.push_back(sub);