]> 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)
committerTomer Haskalovitch <tomer.haska@ibm.com>
Tue, 27 Jan 2026 09:27:36 +0000 (11:27 +0200)
commit5467ad93a5bfbe6dfb73e585111a21003acabe91
treef91a1fe03d4c5fe131c7ce024563a71fd4031344
parentd87ff9590be3ea91514c8e7b5b868f124597a6bf
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>
(cherry picked from commit e55ad7bce2fb85096cd31ff9846403f9dbd01e85)
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/mon_types.h
src/test/cli/monmaptool/feature-set-unset-list.t