3 source $
(dirname $0)/..
/detect-build-env-vars.sh
5 if [ `uname` = FreeBSD
]; then
11 read -r -d '' cm
<<'EOF'
24 id -1 # do not change unnecessarily
28 item device0 weight 10.00000
29 item device1 weight 10.00000
30 item device2 weight 10.00000
31 item device3 weight 10.00000
32 item device4 weight 1.00000
39 step choose firstn 0 type osd
44 three
=($
(echo "$cm" | crushtool
-c /dev
/fd
/0 --test --show-utilization \
45 --min-x 1 --max-x 1000000 --num-rep 3 | \
46 grep "device \(0\|4\)" |
$SED -e 's/^.*stored : \([0-9]\+\).*$/\1/'))
48 if test $
(echo "scale=5; (10 - ${three[0]}/${three[1]}) < .75" |
bc) = 1; then
49 echo 3 replicas weights better distributed than they should be.
1>&2
53 one
=($
(echo "$cm" | crushtool
-c /dev
/fd
/0 --test --show-utilization \
54 --min-x 1 --max-x 1000000 --num-rep 1 | \
55 grep "device \(0\|4\)" |
$SED -e 's/^.*stored : \([0-9]\+\).*$/\1/'))
57 if test $
(echo "scale=5; (10 - ${one[0]}/${one[1]}) > .1 || (10 - ${one[0]}/${one[1]}) < -.1" |
bc) = 1; then
58 echo 1 replica not distributed as they should be.
1>&2