From: Sage Weil Date: Sat, 21 Oct 2017 03:32:33 +0000 (-0500) Subject: messages/MOSDMap: do compat reencode of crush map, too X-Git-Tag: v13.0.1~479^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9eaafc66278d59447b29ce6cc378d0cd3ad14ad4;p=ceph.git messages/MOSDMap: do compat reencode of crush map, too 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 --- diff --git a/src/messages/MOSDMap.h b/src/messages/MOSDMap.h index fa46189bf050..865642cf417c 100644 --- a/src/messages/MOSDMap.h +++ b/src/messages/MOSDMap.h @@ -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::iterator p = maps.begin();