]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: encode `bal_rank_mask` using a higher (next) version 53340/head
authorVenky Shankar <vshankar@redhat.com>
Fri, 1 Dec 2023 09:32:20 +0000 (04:32 -0500)
committerMykola Golub <mgolub@suse.com>
Thu, 14 Dec 2023 11:18:34 +0000 (13:18 +0200)
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 <vshankar@redhat.com>
(cherry picked from commit 36ee8e7ed365933b264321c15f77c0ed1e352d8c)

src/mds/MDSMap.cc

index f1613dbf323ae9c472a6ee7db6662e08bff68715..c15a0e79e03ae7510af4c0ebfd7f904e21f0ffb6 100644 (file)
@@ -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);
   }