Skip to content

Commit 395ff95

Browse files
authored
Merge pull request ceph#55401 from kamoltat/wip-ksirivad-osdmap-encode-bug
src/osd/OSDMap.cc: Fix encoder to produce same bytestream Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents 49d060c + a3bdffb commit 395ff95

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/osd/OSDMap.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,9 @@ void OSDMap::Incremental::encode(ceph::buffer::list& bl, uint64_t features) cons
588588
v = 5;
589589
} else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
590590
v = 6;
591-
} /* else if (!HAVE_FEATURE(features, SERVER_REEF)) {
591+
} else if (!HAVE_FEATURE(features, SERVER_REEF)) {
592592
v = 8;
593-
} */
593+
}
594594
ENCODE_START(v, 1, bl); // client-usable data
595595
encode(fsid, bl);
596596
encode(epoch, bl);
@@ -3021,6 +3021,9 @@ bool OSDMap::primary_changed_broken(
30213021
uint64_t OSDMap::get_encoding_features() const
30223022
{
30233023
uint64_t f = SIGNIFICANT_FEATURES;
3024+
if (require_osd_release < ceph_release_t::reef) {
3025+
f &= ~CEPH_FEATURE_SERVER_REEF;
3026+
}
30243027
if (require_osd_release < ceph_release_t::octopus) {
30253028
f &= ~CEPH_FEATURE_SERVER_OCTOPUS;
30263029
}
@@ -3200,9 +3203,9 @@ void OSDMap::encode(ceph::buffer::list& bl, uint64_t features) const
32003203
v = 6;
32013204
} else if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
32023205
v = 7;
3203-
} /* else if (!HAVE_FEATURE(features, SERVER_REEF)) {
3206+
} else if (!HAVE_FEATURE(features, SERVER_REEF)) {
32043207
v = 9;
3205-
} */
3208+
}
32063209
ENCODE_START(v, 1, bl); // client-usable data
32073210
// base
32083211
encode(fsid, bl);

src/osd/OSDMap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ class OSDMap {
570570
CEPH_FEATUREMASK_SERVER_LUMINOUS |
571571
CEPH_FEATUREMASK_SERVER_MIMIC |
572572
CEPH_FEATUREMASK_SERVER_NAUTILUS |
573-
CEPH_FEATUREMASK_SERVER_OCTOPUS;
573+
CEPH_FEATUREMASK_SERVER_OCTOPUS |
574+
CEPH_FEATUREMASK_SERVER_REEF;
574575

575576
struct addrs_s {
576577
mempool::osdmap::vector<std::shared_ptr<entity_addrvec_t> > client_addrs;

0 commit comments

Comments
 (0)