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>
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();