]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages/MOSDMap: fix compat_version for MOSDMap 21605/head
authorSage Weil <sage@redhat.com>
Thu, 26 Apr 2018 15:31:34 +0000 (10:31 -0500)
committerSage Weil <sage@redhat.com>
Fri, 27 Apr 2018 16:12:43 +0000 (11:12 -0500)
Jewel clients see
 will not decode message of type 41 version 4 because compat_version 4 > supported version 3

The problem is when compat_version == 0 and head_version != 0, we
interpret compat_version == head_version.  From Message::encode,

    // if the encoder didn't specify past compatibility, we assume it
    // is incompatible.
    if (header.compat_version == 0)
      header.compat_version = header.version;

Broken by 49833c3bb264949b8126796997a95a95b50af411 for the
head_version=4 case (compat_version needs to be 3).

Signed-off-by: Sage Weil <sage@redhat.com>
src/messages/MOSDMap.h

index 27aae15570d53de45820f6845750e21de7dd2b64..537c9dd6f6326c16e15f61200b58348017a90418 100644 (file)
@@ -96,11 +96,13 @@ public:
     if (OSDMap::get_significant_features(encode_features) !=
          OSDMap::get_significant_features(features)) {
       if ((features & CEPH_FEATURE_PGID64) == 0 ||
-         (features & CEPH_FEATURE_PGPOOL3) == 0)
+         (features & CEPH_FEATURE_PGPOOL3) == 0) {
        header.version = 1;  // old old_client version
-      else if ((features & CEPH_FEATURE_OSDENC) == 0)
+       header.compat_version = 1;
+      } else if ((features & CEPH_FEATURE_OSDENC) == 0) {
        header.version = 2;  // old pg_pool_t
-      header.compat_version = 0;
+       header.compat_version = 2;
+      }
 
       // reencode maps using old format
       //