From 5eb2367c17823da98b00d5f33f9ff710f4e41a49 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Mon, 28 Mar 2022 20:35:35 +0200 Subject: [PATCH] doc,test: clean up crush rule min/max_size leftovers These fields were removed in quincy in commit f95eb04411cd ("crush: eliminate min_size and max_size"). Signed-off-by: Ilya Dryomov (cherry picked from commit 1ab943cabb7677f9465e92a00a84d2bfca60beb7) --- doc/rados/operations/crush-map-edits.rst | 22 -------- doc/rados/operations/crush-map.rst | 2 - src/script/set_up_stretch_mode.sh | 6 -- src/test/cli/crushtool/simple.template.three | 6 -- src/test/test_pool_create.sh | 58 -------------------- 5 files changed, 94 deletions(-) delete mode 100755 src/test/test_pool_create.sh diff --git a/doc/rados/operations/crush-map-edits.rst b/doc/rados/operations/crush-map-edits.rst index bb7ba0b2e92f9..88ac45705a6a6 100644 --- a/doc/rados/operations/crush-map-edits.rst +++ b/doc/rados/operations/crush-map-edits.rst @@ -407,8 +407,6 @@ A rule takes the following form:: id [a unique whole numeric ID] type [ replicated | erasure ] - min_size - max_size step take [class ] step [choose|chooseleaf] [firstn|indep] type step emit @@ -436,26 +434,6 @@ A rule takes the following form:: :Default: ``replicated`` :Valid Values: Currently only ``replicated`` and ``erasure`` -``min_size`` - -:Description: If a pool makes fewer replicas than this number, CRUSH will - **NOT** select this rule. - -:Type: Integer -:Purpose: A component of the rule mask. -:Required: Yes -:Default: ``1`` - -``max_size`` - -:Description: If a pool makes more replicas than this number, CRUSH will - **NOT** select this rule. - -:Type: Integer -:Purpose: A component of the rule mask. -:Required: Yes -:Default: 10 - ``step take [class ]`` diff --git a/doc/rados/operations/crush-map.rst b/doc/rados/operations/crush-map.rst index 942b1fa822446..a27640ab197f9 100644 --- a/doc/rados/operations/crush-map.rst +++ b/doc/rados/operations/crush-map.rst @@ -1128,8 +1128,6 @@ not to contain any of the same servers, as seen in the following CRUSH rule:: rule mixed_replicated_rule_two { id 1 type replicated - min_size 1 - max_size 10 step take ssd_hosts class ssd step chooseleaf firstn 1 type host step emit diff --git a/src/script/set_up_stretch_mode.sh b/src/script/set_up_stretch_mode.sh index a28f181e6c6fd..79b214915d995 100755 --- a/src/script/set_up_stretch_mode.sh +++ b/src/script/set_up_stretch_mode.sh @@ -15,8 +15,6 @@ cat <> crush.map.txt rule stretch_rule { id 1 type replicated - min_size 1 - max_size 10 step take site1 step chooseleaf firstn 2 type host step emit @@ -27,8 +25,6 @@ rule stretch_rule { rule stretch_rule2 { id 2 type replicated - min_size 1 - max_size 10 step take site1 step chooseleaf firstn 2 type host step emit @@ -39,8 +35,6 @@ rule stretch_rule2 { rule stretch_rule3 { id 3 type replicated - min_size 1 - max_size 10 step take site1 step chooseleaf firstn 2 type host step emit diff --git a/src/test/cli/crushtool/simple.template.three b/src/test/cli/crushtool/simple.template.three index 4dcb1505d8563..33ebc662a2573 100644 --- a/src/test/cli/crushtool/simple.template.three +++ b/src/test/cli/crushtool/simple.template.three @@ -30,8 +30,6 @@ cluster cluster0 { rule data { id 0 type replicated - min_size 1 - max_size 10 step take cluster0 step chooseleaf firstn 0 type host step emit @@ -39,8 +37,6 @@ rule data { rule metadata { id 1 type replicated - min_size 1 - max_size 10 step take cluster0 step chooseleaf firstn 0 type host step emit @@ -48,8 +44,6 @@ rule metadata { rule rbd { id 2 type replicated - min_size 1 - max_size 10 step take cluster0 step chooseleaf firstn 0 type host step emit diff --git a/src/test/test_pool_create.sh b/src/test/test_pool_create.sh deleted file mode 100755 index 5dd5aeda1c2e1..0000000000000 --- a/src/test/test_pool_create.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash - - -#Generic create pool use crush rule test -# - -# Includes -source ../qa/standalone/ceph-helpers.sh - -function run() { - local dir=$1 - shift - - export CEPH_MON="127.0.0.1:17109" # git grep '\<17109\>' : there must be only one - export CEPH_ARGS - CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none " - CEPH_ARGS+="--mon-host=$CEPH_MON " - - local funcs=${@:-$(set | sed -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')} - for func in $funcs ; do - $func $dir || return 1 - done -} - -function TEST_pool_create() { - local dir=$1 - setup $dir || return 1 - run_mon $dir a || return 1 - run_osd $dir 0 || return 1 - run_osd $dir 1 || return 1 - run_osd $dir 2 || return 1 - - local rulename=testrule - local poolname=rulepool - local var=`ceph osd crush rule dump|grep -w rule|sed -n '$p'|grep -o '[0-9]\+'` - var=`expr $var + 1 ` - ceph osd getcrushmap -o "$dir/map1" - crushtool -d "$dir/map1" -o "$dir/map1.txt" - - local minsize=0 - local maxsize=1 - sed -i '/# end crush map/i\rule '$rulename' {\n id \'$var'\n type replicated\n min_size \'$minsize'\n max_size \'$maxsize'\n step take default\n step choose firstn 0 type osd\n step emit\n }\n' "$dir/map1.txt" - crushtool -c "$dir/map1.txt" -o "$dir/map1.bin" - ceph osd setcrushmap -i "$dir/map1.bin" - ceph osd pool create $poolname 200 $rulename 2>"$dir/rev" - local result=$(cat "$dir/rev" | grep "Error EINVAL: pool size") - - if [ "$result" = "" ]; - then - ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it - ceph osd crush rule rm $rulename - return 1 - fi - ceph osd crush rule rm $rulename -} - -main testpoolcreate - -- 2.39.5