From: Sage Weil Date: Mon, 28 Oct 2019 14:21:58 +0000 (-0500) Subject: mon/OSDMonitor: expand iec_options for 'osd pool set' X-Git-Tag: v15.1.0~1094^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9095f67e921bcbc95b9f7dc793643edbc6c51cf6;p=ceph-ci.git mon/OSDMonitor: expand iec_options for 'osd pool set' Signed-off-by: Sage Weil --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 8cdf1ed5d32..46aefbef88e 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -2275,6 +2275,18 @@ function test_mon_osd_pool_set() ceph osd pool get rbd crush_rule | grep 'crush_rule: ' + # iec vs si units + ceph osd pool set $TEST_POOLGETSET target_max_objects 1K + ceph osd pool get $TEST_POOLGETSET target_max_objects | grep 1000 + for o in target_max_bytes target_size_bytes compression_max_blob_size compression_min_blob_size csum_max_block csum_min_block; do + ceph osd pool set $TEST_POOLGETSET $o 1Ki # no i suffix + val=$(ceph osd pool get $TEST_POOLGETSET $o --format=json | jq -c ".$o") + [[ $val == 1024 ]] + ceph osd pool set $TEST_POOLGETSET $o 1M # with i suffix + val=$(ceph osd pool get $TEST_POOLGETSET $o --format=json | jq -c ".$o") + [[ $val == 1048576 ]] + done + ceph osd pool get $TEST_POOL_GETSET compression_mode | expect_false grep '.' ceph osd pool set $TEST_POOL_GETSET compression_mode aggressive ceph osd pool get $TEST_POOL_GETSET compression_mode | grep 'aggressive' diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index b15eb8e6873..f06d07d19d1 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7860,8 +7860,17 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, int64_t uf = 0; // micro-f cmd_getval(cct, cmdmap, "val", val); - auto si_options = {"target_max_objects"}; - auto iec_options = {"target_max_bytes", "target_size_bytes"}; + auto si_options = { + "target_max_objects" + }; + auto iec_options = { + "target_max_bytes", + "target_size_bytes", + "compression_max_blob_size", + "compression_min_blob_size", + "csum_max_block", + "csum_min_block", + }; if (count(begin(si_options), end(si_options), var)) { n = strict_si_cast(val.c_str(), &interr); } else if (count(begin(iec_options), end(iec_options), var)) {