From d8cebd674ec49cd1981f6ee4038318b8f675fb9d Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Fri, 1 Dec 2023 04:32:20 -0500 Subject: [PATCH] mds: encode `bal_rank_mask` using a higher (next) version This is required for a reef client to work with a higher revision MDS, since essentially, this happens: reef(client): if (version >=17) { decode(bal_rank_mask, p); } and higher-revision MDS (say, upcoming squid): version = 17 encode(version, bl); ... ... encode(max_xattr_size, bl); encode(bal_rank_mask, bl); The client incorrectly decodes max_xattr_size (type: uint64_t) into bal_rank_mask (type: string). This situation ended up due to a couple of reasons: * the kclient patchset hanlding `max_xattr_size` was merged early on and another MDS side change that bumped the MDSMap encoding version to 17 got merged in the midst (PR #43284). Details in comment: https://github.com/ceph/ceph/pull/46357#issuecomment-1293556227 * The reef backport for PR #46357 got delayed (and, reef branched out). Which means reef(18.2.0) user-space clients are broken with higher version MDSs. Fixes: https://tracker.ceph.com/issues/63713 Signed-off-by: Venky Shankar (cherry picked from commit 36ee8e7ed365933b264321c15f77c0ed1e352d8c) --- src/mds/MDSMap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mds/MDSMap.cc b/src/mds/MDSMap.cc index f1613dbf323ae..c15a0e79e03ae 100644 --- a/src/mds/MDSMap.cc +++ b/src/mds/MDSMap.cc @@ -768,7 +768,7 @@ void MDSMap::encode(bufferlist& bl, uint64_t features) const encode(data_pools, bl); encode(cas_pool, bl); - __u16 ev = 17; + __u16 ev = 18; encode(ev, bl); encode(compat, bl); encode(metadata_pool, bl); @@ -946,6 +946,9 @@ void MDSMap::decode(bufferlist::const_iterator& p) if (ev >= 17) { decode(max_xattr_size, p); + } + + if (ev >= 18) { decode(bal_rank_mask, p); } -- 2.39.5