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