2020-03-12 02:13:29 +03:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
2022-06-03 01:56:36 +03:00
|
|
|
OSD_COUNT=7
|
|
|
|
PG_COUNT=32
|
|
|
|
. `dirname $0`/run_3osds.sh
|
2020-03-12 02:13:29 +03:00
|
|
|
|
2021-03-13 02:05:28 +03:00
|
|
|
IMG_SIZE=960
|
|
|
|
|
2022-05-05 02:11:34 +03:00
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
2020-03-12 02:13:29 +03:00
|
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=4M -direct=1 -iodepth=16 -fsync=16 -rw=write \
|
2021-03-13 02:05:28 +03:00
|
|
|
-etcd=$ETCD_URL -pool=1 -inode=2 -size=${IMG_SIZE}M -cluster_log_level=10
|
2020-03-12 02:13:29 +03:00
|
|
|
|
|
|
|
try_reweight 1 0
|
|
|
|
|
|
|
|
try_reweight 2 0
|
|
|
|
|
|
|
|
try_reweight 3 0
|
|
|
|
|
|
|
|
try_reweight 4 0
|
|
|
|
|
|
|
|
try_reweight 5 0
|
|
|
|
|
|
|
|
try_reweight 1 1
|
|
|
|
|
|
|
|
try_reweight 2 1
|
|
|
|
|
|
|
|
try_reweight 3 1
|
|
|
|
|
|
|
|
try_reweight 4 1
|
|
|
|
|
|
|
|
try_reweight 5 1
|
|
|
|
|
2023-05-12 23:16:20 +03:00
|
|
|
# Allow rebalance to start
|
|
|
|
sleep 5
|
|
|
|
|
2020-03-12 02:13:29 +03:00
|
|
|
# Wait for the rebalance to finish
|
2023-05-11 01:16:07 +03:00
|
|
|
wait_finish_rebalance 300
|
2020-03-12 02:13:29 +03:00
|
|
|
|
2021-03-13 02:05:28 +03:00
|
|
|
# Check that PGs never had degraded objects !
|
2022-06-05 00:06:53 +03:00
|
|
|
# FIXME: In fact, the test doesn't guarantee it because PGs aren't always peered only with full prior OSD sets :-(
|
|
|
|
#if grep has_degraded ./testdata/mon.log; then
|
|
|
|
# format_error "Some copies of objects were lost during interrupted rebalancings"
|
|
|
|
#fi
|
2020-03-12 02:13:29 +03:00
|
|
|
|
|
|
|
# Check that no objects are lost !
|
|
|
|
nobj=`$ETCDCTL get --prefix '/vitastor/pg/stats' --print-value-only | jq -s '[ .[].object_count ] | reduce .[] as $num (0; .+$num)'`
|
2022-06-03 01:56:36 +03:00
|
|
|
if [ "$nobj" -ne $((IMG_SIZE*8/PG_DATA_SIZE)) ]; then
|
2020-03-12 02:13:29 +03:00
|
|
|
format_error "Data lost after multiple interrupted rebalancings"
|
|
|
|
fi
|
|
|
|
|
|
|
|
format_green OK
|