]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
messages/MOSDMap: do compat reencode of crush map, too
authorSage Weil <sage@redhat.com>
Sat, 21 Oct 2017 03:32:33 +0000 (22:32 -0500)
committerSage Weil <sage@redhat.com>
Sat, 21 Oct 2017 03:36:57 +0000 (22:36 -0500)
If we are reencoding an incremental, and it embeds a crush map, we need
to reencode that in a compatible way too.  This is especially true now
because we have the compat crush weight-sets.  Otherwise, a client may
learn the crush map through an incremental but not understand choose_args,
and not see/understand the alternate weight set.  It will send requests
to the wrong OSDs where they will just get dropped.

Fixes: http://tracker.ceph.com/issues/21882
Signed-off-by: Sage Weil <sage@redhat.com>
src/messages/MOSDMap.h

index fa46189bf0504c6c811ef17a10b154732177b7ee..865642cf417c30f487fb3a698946a20e86f8075f 100644 (file)
@@ -113,6 +113,14 @@ public:
          inc.fullmap.clear();
          m.encode(inc.fullmap, features | CEPH_FEATURE_RESERVED);
        }
+       if (inc.crush.length()) {
+         // embedded crush map
+         CrushWrapper c;
+         auto p = inc.crush.begin();
+         c.decode(p);
+         inc.crush.clear();
+         c.encode(inc.crush, features);
+       }
        inc.encode(p->second, features | CEPH_FEATURE_RESERVED);
       }
       for (map<epoch_t,bufferlist>::iterator p = maps.begin();