Was:
./bin/ceph osd crush weight-set reweight rbd osd.0 1 2 3 4 5
Error ENOENT: weight_set_size != 5 for bucket -1weight_set_size != 5 for bucket -2weight_set_size != 5 for bucket -3weight_set_size != 5 for bucket -4item 0 not found in crush map
Now:
./bin/ceph osd crush weight-set reweight rbd osd.0 1 2 3 4 5
Error EINVAL: must specify exact 3 weight values
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
err = -ENOENT;
goto reply;
}
+ auto arg_map = newcrush.choose_args_get(pool);
+ int positions = newcrush.get_choose_args_positions(arg_map);
+ if (weight.size() != (size_t)positions) {
+ ss << "must specify exact " << positions << " weight values";
+ err = -EINVAL;
+ goto reply;
+ }
} else {
pool = CrushWrapper::DEFAULT_CHOOSE_ARGS;
if (!newcrush.have_choose_args(pool)) {