Skip to content

Commit 3c50ef6

Browse files
committed
mon/NVMeofGw*: support upgrades from prior out-of-tree nvmeofha implementation (nvmeof-reef)
This commit adds upgrade support for users running an experimental nvmeofha implementation which can be found in the nvmeof-reef branch in ceph.git. Signed-off-by: Leonid Chernin <[email protected]>
1 parent b9359a3 commit 3c50ef6

File tree

6 files changed

+232
-90
lines changed

6 files changed

+232
-90
lines changed

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)