Skip to content

Commit 2e813d0

Browse files
authored
Merge pull request ceph#59240 from leonidc/wip-leonidc-20241508-upgrade-rules-centos9-only
upgrade rules for NVMeofGW monitors and gateways
2 parents b8db14c + 3c50ef6 commit 2e813d0

File tree

7 files changed

+234
-93
lines changed

7 files changed

+234
-93
lines changed

src/include/ceph_features.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,13 @@ DEFINE_CEPH_FEATURE(35, 1, OSD_CACHEPOOL) // 3.14
138138
DEFINE_CEPH_FEATURE(36, 1, CRUSH_V2) // 3.14
139139
DEFINE_CEPH_FEATURE(37, 1, EXPORT_PEER) // 3.14
140140
DEFINE_CEPH_FEATURE(38, 2, CRUSH_MSR) // X.XX kernel version once in a release
141-
// available
142141
DEFINE_CEPH_FEATURE(39, 1, OSDMAP_ENC) // 3.15
143142
DEFINE_CEPH_FEATURE(40, 1, MDS_INLINE_DATA) // 3.19
144143
DEFINE_CEPH_FEATURE(41, 1, CRUSH_TUNABLES3) // 3.15
145144
DEFINE_CEPH_FEATURE(41, 1, OSD_PRIMARY_AFFINITY) // overlap
146145
DEFINE_CEPH_FEATURE(42, 1, MSGR_KEEPALIVE2) // 4.3 (for consistency)
147146
DEFINE_CEPH_FEATURE(43, 1, OSD_POOLRESEND) // 4.13
148-
DEFINE_CEPH_FEATURE_RETIRED(44, 1, ERASURE_CODE_PLUGINS_V2, MIMIC, OCTOPUS)
149-
// available
147+
DEFINE_CEPH_FEATURE(44, 2, NVMEOFHA)
150148
DEFINE_CEPH_FEATURE_RETIRED(45, 1, OSD_SET_ALLOC_HINT, JEWEL, LUMINOUS)
151149
// available
152150
DEFINE_CEPH_FEATURE(46, 1, OSD_FADVISE_FLAGS)
@@ -225,6 +223,7 @@ DEFINE_CEPH_FEATURE_RETIRED(63, 1, RESERVED_BROKEN, LUMINOUS, QUINCY) // client-
225223
CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \
226224
CEPH_FEATURE_MSGR_KEEPALIVE2 | \
227225
CEPH_FEATURE_OSD_POOLRESEND | \
226+
CEPH_FEATUREMASK_NVMEOFHA | \
228227
CEPH_FEATURE_OSD_FADVISE_FLAGS | \
229228
CEPH_FEATURE_MDS_QUOTA | \
230229
CEPH_FEATURE_CRUSH_V4 | \

src/messages/MNVMeofGwMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MNVMeofGwMap final : public Message {
5656
using ceph::encode;
5757
encode(VERSION, payload);
5858
encode(gwmap_epoch, payload);
59-
encode(map, payload);
59+
encode(map, payload, features);
6060
}
6161
private:
6262
using RefCountedObject::put;

src/mon/NVMeofGwMap.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ int NVMeofGwMap::cfg_add_gw(
8383
return -EEXIST ;
8484
}
8585
}
86+
if (allocated.size() == MAX_SUPPORTED_ANA_GROUPS) {
87+
dout(4) << "Warning: cannot add GW " << gw_id
88+
<< " since number GWs in the group is "
89+
<< MAX_SUPPORTED_ANA_GROUPS << dendl;
90+
return -EINVAL;
91+
}
8692
// Allocate the new group id
8793
NvmeAnaGrpId i = 0;
8894
bool was_allocated = false;

src/mon/NVMeofGwMap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ class NVMeofGwMap
106106
const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
107107
NvmeAnaGrpId ANA_groupid, epoch_t &epoch, bool failover);
108108

109-
void encode(ceph::buffer::list &bl) const {
109+
void encode(ceph::buffer::list &bl, uint64_t features) const {
110110
using ceph::encode;
111111
ENCODE_START(1, 1, bl);
112112
encode(epoch, bl);// global map epoch
113113

114-
encode(created_gws, bl); //Encode created GWs
115-
encode(fsm_timers, bl);
114+
encode(created_gws, bl, features); //Encode created GWs
115+
encode(fsm_timers, bl, features);
116116
ENCODE_FINISH(bl);
117117
}
118118

src/mon/NVMeofGwMon.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ void NVMeofGwMon::encode_pending(MonitorDBStore::TransactionRef t)
158158
dout(10) << dendl;
159159
ceph_assert(get_last_committed() + 1 == pending_map.epoch);
160160
bufferlist bl;
161-
pending_map.encode(bl);
161+
uint64_t features = mon.get_quorum_con_features();
162+
pending_map.encode(bl, features);
163+
dout(10) << " has NVMEOFHA: "
164+
<< HAVE_FEATURE(mon.get_quorum_con_features(), NVMEOFHA) << dendl;
162165
put_version(t, pending_map.epoch, bl);
163166
put_last_committed(t, pending_map.epoch);
164167
}

0 commit comments

Comments
 (0)