]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: add NVMEOF_BEACON_DIFF to mon_feature_t and mon CompatSet
authorSamuel Just <sjust@redhat.com>
Thu, 6 Nov 2025 23:54:50 +0000 (23:54 +0000)
committerLeonid Chernin <leonidc@il.ibm.com>
Thu, 11 Dec 2025 17:50:59 +0000 (19:50 +0200)
commite55ad7bce2fb85096cd31ff9846403f9dbd01e85
tree106154ad39d892202dfadfe017ea417d9f9bb868
parent958080913083af4805f0cc4114c5c96606b05212
mon: add NVMEOF_BEACON_DIFF to mon_feature_t and mon CompatSet

NOPE NOPE
In order for the client to safely send BEACON_DIFF messages, it
needs to be the case that the leader at the time of receipt will
support BEACON_DIFF.

Simply using the connection features for the MonClient's target mon is
insufficient, because it might be a peon.  If the peon supports
BEACON_DIFF and the leader does not the leader will either crash or
interpret it as a full BEACON.  Neither outcome is acceptable.

Instead, we need to wire up a feature bit to the MonMap mon_feature_t
members and the CompatSet.

Adding FEATURE_BEACON_DIFF to ceph::features::mon get_supported()
and get_persistent() ensures that once all monitors in the quorum
support it, MonMap::get_required_features() will include it.
See Elector::propose_to_peers, Monitor::(win|lose)_election,
MonmapMonitor::apply_mon_features.

Once FEATURE_BEACON_DIFF is present in MonMap::get_required_features():
- Monitor::apply_monmap_to_compatset_features() will prevent
  downgrades of the monitors by updating the CompatSet to include
  CEPH_MON_FEATURE_INCOMPAT_NVMEOF_BEACON_DIFF
- Monitor::calc_quorum_requirements() will set
  Monitor::required_features to require the NVMEOF_BEACON_DIFF
  for any monitor peers.
- MonClient::get_monmap_required_features() will eventually include
  ceph::features::mon::FEATURE_NVMEOF_BEACON_DIFF.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/mon_types.h
src/test/cli/monmaptool/feature-set-unset-list.t