From 501aa74d5599cddc73fe787c308871b47681bc29 Mon Sep 17 00:00:00 2001 From: Kamoltat Date: Wed, 31 Jan 2024 15:25:10 +0000 Subject: [PATCH] src/osd/OSDMap.cc: Fix encoder to produce same bytestream Fixes: https://tracker.ceph.com/issues/63389 Signed-off-by: Kamoltat (cherry picked from commit a3bdffb4e0366af8288258539f17bafeae17e3c4) --- src/osd/OSDMap.cc | 11 +++++++---- src/osd/OSDMap.h | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index b5829bc3b71a7..116ccea047f91 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -588,9 +588,9 @@ void OSDMap::Incremental::encode(ceph::buffer::list& bl, uint64_t features) cons v = 5; } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) { v = 6; - } /* else if (!HAVE_FEATURE(features, SERVER_REEF)) { + } else if (!HAVE_FEATURE(features, SERVER_REEF)) { v = 8; - } */ + } ENCODE_START(v, 1, bl); // client-usable data encode(fsid, bl); encode(epoch, bl); @@ -3021,6 +3021,9 @@ bool OSDMap::primary_changed_broken( uint64_t OSDMap::get_encoding_features() const { uint64_t f = SIGNIFICANT_FEATURES; + if (require_osd_release < ceph_release_t::reef) { + f &= ~CEPH_FEATURE_SERVER_REEF; + } if (require_osd_release < ceph_release_t::octopus) { f &= ~CEPH_FEATURE_SERVER_OCTOPUS; } @@ -3200,9 +3203,9 @@ void OSDMap::encode(ceph::buffer::list& bl, uint64_t features) const v = 6; } else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) { v = 7; - } /* else if (!HAVE_FEATURE(features, SERVER_REEF)) { + } else if (!HAVE_FEATURE(features, SERVER_REEF)) { v = 9; - } */ + } ENCODE_START(v, 1, bl); // client-usable data // base encode(fsid, bl); diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 0378afdc186dd..97d6b7e1b8bfe 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -570,7 +570,8 @@ private: CEPH_FEATUREMASK_SERVER_LUMINOUS | CEPH_FEATUREMASK_SERVER_MIMIC | CEPH_FEATUREMASK_SERVER_NAUTILUS | - CEPH_FEATUREMASK_SERVER_OCTOPUS; + CEPH_FEATUREMASK_SERVER_OCTOPUS | + CEPH_FEATUREMASK_SERVER_REEF; struct addrs_s { mempool::osdmap::vector > client_addrs; -- 2.39.5