private:
static constexpr int BEACON_VERSION_LEGACY = 1; // legacy beacon format (no diff support)
static constexpr int BEACON_VERSION_ENHANCED = 2; // enhanced beacon format (with diff support)
- static constexpr int COMPAT_VERSION = BEACON_VERSION_ENHANCED; // minimum version to decode enhanced format
+ static constexpr int COMPAT_VERSION = BEACON_VERSION_LEGACY; // minimum version to decode enhanced format
protected:
std::string gw_id;
NvmeGwMonState& gw_map = created_gws[group_key][gw_id];
//gw_map.beacon_sequence_ooo = false;
- if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOF_BEACON_DIFF) &&
+ if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOF_BEACON_DIFF) ||
(gw_version > 0) ) {
if (beacon_sequence == 40 && inject1 == 0) { //Inject sequence ooo
inject1 = 1;
int gw_version, const NvmeGroupKey& group_key, uint64_t beacon_sequence)
{
NvmeGwMonState& gw_map = created_gws[group_key][gw_id];
- if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOF_BEACON_DIFF) &&
+ if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOF_BEACON_DIFF) ||
(gw_version > 0)) {
gw_map.beacon_sequence = beacon_sequence;
+ gw_map.beacon_sequence_ooo = false;
dout(10) << gw_id << " set beacon_sequence " << beacon_sequence << dendl;
}
return true;
pending_map.encode(bl, features);
dout(10) << " has NVMEOFHA: " << HAVE_FEATURE(features, NVMEOFHA)
<< " has NVMEOFHAMAP: " << HAVE_FEATURE(features, NVMEOFHAMAP)
- << " has BEACON_DIFF: " << HAVE_FEATURE(features,NVMEOFHAMAP) << dendl;// BEACONDIFF
+ << " has BEACON_DIFF: " << HAVE_FEATURE(features, NVMEOF_BEACON_DIFF) << dendl;
put_version(t, pending_map.epoch, bl);
put_last_committed(t, pending_map.epoch);
{
version_t version = get_last_committed();
uint64_t features = mon.get_quorum_con_features();
- dout(10) << " has BEACON_DIFF: " << HAVE_FEATURE(features,NVMEOFHAMAP)
+ dout(10) << " has BEACON_DIFF: " << HAVE_FEATURE(features, NVMEOF_BEACON_DIFF)
<< dendl;
if (version != map.epoch) {
dout(10) << " NVMeGW loading version " << version
" sending ACK due to receiving beacon_sequence out of order" << dendl;
ack_map.created_gws[group_key][gw_id].beacon_sequence = stored_sequence;
ack_map.created_gws[group_key][gw_id].beacon_sequence_ooo = true;
+ } else {
+ ack_map.created_gws[group_key][gw_id].beacon_sequence_ooo = false;
}
if (gw_propose) {
dout(10) << "GW in Created " << gw_id << " ack map " << ack_map << dendl;
pending_map.created_gws[group_key][gw_id].subsystems;
auto &state = pending_map.created_gws[group_key][gw_id];
- if (!HAVE_FEATURE(mon.get_quorum_con_features(), NVMEOF_BEACON_DIFF) ||
+ if (!HAVE_FEATURE(mon.get_quorum_con_features(), NVMEOF_BEACON_DIFF) &&
gw_version == 0) {
if (gw_subs != sub) {
dout(10) << "BEACON_DIFF logic not applied."
if (HAVE_FEATURE(features, NVMEOF_BEACON_DIFF)) {
version = BEACON_SUBSYS_VERSION_ENHANCED; // Use enhanced version if feature supported
}
-
// For legacy encoding, skip deleted subsystems to maintain compatibility
- if (version == BEACON_SUBSYS_VERSION_LEGACY && sub.change_descriptor == subsystem_change_t::SUBSYSTEM_DELETED) {
- dout(20) << "encode BeaconSubsystem: skipping deleted subsystem " << sub.nqn << " in legacy mode" << dendl;
- return; // Skip encoding this subsystem entirely
+ if (version == BEACON_SUBSYS_VERSION_LEGACY && 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);
NvmeNqnId nqn;
std::list<BeaconListener> listeners;
std::list<BeaconNamespace> namespaces;
- subsystem_change_t change_descriptor;
+ subsystem_change_t change_descriptor = subsystem_change_t::SUBSYSTEM_ADDED;
// Define the equality operator
bool operator==(const BeaconSubsystem& other) const {