uint64_t OSDMap::get_encoding_features() const
{
uint64_t f = SIGNIFICANT_FEATURES;
+ if (require_osd_release < ceph_release_t::tentacle) {
+ f &= ~CEPH_FEATURE_SERVER_TENTACLE;
+ }
if (require_osd_release < ceph_release_t::reef) {
f &= ~CEPH_FEATURE_SERVER_REEF;
}
CEPH_FEATUREMASK_SERVER_MIMIC |
CEPH_FEATUREMASK_SERVER_NAUTILUS |
CEPH_FEATUREMASK_SERVER_OCTOPUS |
- CEPH_FEATUREMASK_SERVER_REEF;
+ CEPH_FEATUREMASK_SERVER_REEF |
+ CEPH_FEATUREMASK_SERVER_TENTACLE;
struct addrs_s {
mempool::osdmap::vector<std::shared_ptr<entity_addrvec_t> > client_addrs;
return SIGNIFICANT_FEATURES & features;
}
+ template<uint64_t feature>
+ requires ((SIGNIFICANT_FEATURES & feature) == feature)
+ static constexpr bool have_significant_feature(uint64_t x) {
+ return (x & feature) == feature;
+ }
+
uint64_t get_encoding_features() const;
void deepish_copy_from(const OSDMap& o) {
WRITE_CLASS_ENCODER_FEATURES(OSDMap)
WRITE_CLASS_ENCODER_FEATURES(OSDMap::Incremental)
+#define HAVE_SIGNIFICANT_FEATURE(x, name) \
+(OSDMap::have_significant_feature<CEPH_FEATUREMASK_##name>(x))
+
#ifdef WITH_CRIMSON
#include "crimson/common/local_shared_foreign_ptr.h"
using LocalOSDMapRef = boost::local_shared_ptr<const OSDMap>;
void pg_pool_t::encode(ceph::buffer::list& bl, uint64_t features) const
{
using ceph::encode;
- if ((features & CEPH_FEATURE_PGPOOL3) == 0) {
+ if (!HAVE_SIGNIFICANT_FEATURE(features, PGPOOL3)) {
// this encoding matches the old struct ceph_pg_pool
__u8 struct_v = 2;
encode(struct_v, bl);
return;
}
- if ((features & CEPH_FEATURE_OSDENC) == 0) {
+ if (!HAVE_SIGNIFICANT_FEATURE(features, OSDENC)) {
__u8 struct_v = 4;
encode(struct_v, bl);
encode(type, bl);
return;
}
- if ((features & CEPH_FEATURE_OSD_POOLRESEND) == 0) {
+ if (!HAVE_SIGNIFICANT_FEATURE(features, OSD_POOLRESEND)) {
// we simply added last_force_op_resend here, which is a fully
// backward compatible change. however, encoding the same map
// differently between monitors triggers scrub noise (even though
uint8_t v = 31;
// NOTE: any new encoding dependencies must be reflected by
// SIGNIFICANT_FEATURES
- if (!HAVE_FEATURE(features, SERVER_TENTACLE)) {
- if (!(features & CEPH_FEATURE_NEW_OSDOP_ENCODING)) {
+ if (!HAVE_SIGNIFICANT_FEATURE(features, SERVER_TENTACLE)) {
+ if (!HAVE_SIGNIFICANT_FEATURE(features, NEW_OSDOP_ENCODING)) {
// this was the first post-hammer thing we added; if it's missing, encode
// like hammer.
v = 21;
- } else if (!HAVE_FEATURE(features, SERVER_LUMINOUS)) {
+ } else if (!HAVE_SIGNIFICANT_FEATURE(features, SERVER_LUMINOUS)) {
v = 24;
- } else if (!HAVE_FEATURE(features, SERVER_MIMIC)) {
+ } else if (!HAVE_SIGNIFICANT_FEATURE(features, SERVER_MIMIC)) {
v = 26;
- } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
+ } else if (!HAVE_SIGNIFICANT_FEATURE(features, SERVER_NAUTILUS)) {
v = 27;
} else if (!is_stretch_pool()) {
v = 29;