See https://github.com/ceph/ceph/pull/26705
Fixes: http://tracker.ceph.com/issues/38578
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
ceph osd pool get $TEST_POOL_GETSET recovery_priority | grep 'recovery_priority: 5'
ceph osd pool set $TEST_POOL_GETSET recovery_priority 0
ceph osd pool get $TEST_POOL_GETSET recovery_priority | expect_false grep '.'
+ expect_false ceph osd pool set $TEST_POOL_GETSET recovery_priority -1
+ expect_false ceph osd pool set $TEST_POOL_GETSET recovery_priority 30
ceph osd pool get $TEST_POOL_GETSET recovery_op_priority | expect_false grep '.'
ceph osd pool set $TEST_POOL_GETSET recovery_op_priority 5
<< " > pg_num " << p.get_pg_num_target();
return -EINVAL;
}
+ } else if (var == "recovery_priority") {
+ if (interr.length()) {
+ ss << "error parsing int value '" << val << "': " << interr;
+ return -EINVAL;
+ }
+ if (n < 0) {
+ ss << "pool recovery_priority can not be negative";
+ return -EINVAL;
+ } else if (n >= 30) {
+ ss << "pool recovery_priority should be less than 30 due to "
+ << "Ceph internal implementation restrictions";
+ return -EINVAL;
+ }
}
pool_opts_t::opt_desc_t desc = pool_opts_t::get_opt_desc(var);