]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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>
Wed, 26 Nov 2025 07:59:12 +0000 (09:59 +0200)
commitbd36bbde68010d81f411a507e58d6e7182e2712d
tree74c0481dfd1194cdc7c964078ad5a5b7a2711c92
parentf3115b8152f292c89298f9668daf6f54e84c2b5f
mon: add NVMEOF_BEACON_DIFF to mon_feature_t and mon CompatSet

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