3 source $
(dirname $0)/..
/detect-build-env-vars.sh
5 read -r -d '' cm
<<'EOF'
18 id -1 # do not change unnecessarily
22 item device0 weight 10.0
23 item device1 weight 10.0
24 item device2 weight 10.0
25 item device3 weight 10.0
26 item device4 weight 1.000
35 step choose firstn 0 type osd
40 three
=($
(echo "$cm" | crushtool
-c /dev
/fd
/0 --test --show-utilization \
41 --min-x 1 --max-x 1000000 --num-rep 3 | \
42 grep "device \(0\|4\)" |
sed -e 's/^.*stored : \([0-9]\+\).*$/\1/'))
44 if test $
(echo "scale=5; (10 - ${three[0]}/${three[1]}) < .75" |
bc) = 1; then
45 echo 3 replicas weights better distributed than they should be.
1>&2
49 one
=($
(echo "$cm" | crushtool
-c /dev
/fd
/0 --test --show-utilization \
50 --min-x 1 --max-x 1000000 --num-rep 1 | \
51 grep "device \(0\|4\)" |
sed -e 's/^.*stored : \([0-9]\+\).*$/\1/'))
53 if test $
(echo "scale=5; (10 - ${one[0]}/${one[1]}) > .1 || (10 - ${one[0]}/${one[1]}) < -.1" |
bc) = 1; then
54 echo 1 replica not distributed as they should be.
1>&2