2022-05-21 10:08:08 +03:00
|
|
|
#!/bin/bash -ex
|
|
|
|
|
|
|
|
# Kill OSDs while writing
|
|
|
|
|
2023-05-11 01:16:07 +03:00
|
|
|
PG_SIZE=${PG_SIZE:-3}
|
|
|
|
if [[ "$SCHEME" = "ec" ]]; then
|
|
|
|
PG_DATA_SIZE=${PG_DATA_SIZE:-2}
|
|
|
|
PG_MINSIZE=${PG_MINSIZE:-3}
|
|
|
|
fi
|
2023-10-04 01:01:36 +03:00
|
|
|
OSD_COUNT=${OSD_COUNT:-7}
|
2022-06-03 01:56:36 +03:00
|
|
|
PG_COUNT=32
|
|
|
|
. `dirname $0`/run_3osds.sh
|
|
|
|
check_qemu
|
2022-05-21 10:08:08 +03:00
|
|
|
|
2022-11-29 01:37:45 +03:00
|
|
|
# FIXME: Fix space rebalance priorities :)
|
2022-05-21 10:08:08 +03:00
|
|
|
IMG_SIZE=960
|
|
|
|
|
|
|
|
$ETCDCTL put /vitastor/config/inode/1/1 '{"name":"testimg","size":'$((IMG_SIZE*1024*1024))'}'
|
|
|
|
|
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
|
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=4M -direct=1 -iodepth=1 -fsync=1 -rw=write \
|
|
|
|
-mirror_file=./testdata/mirror.bin -etcd=$ETCD_URL -image=testimg -cluster_log_level=10
|
|
|
|
|
|
|
|
kill_osds()
|
|
|
|
{
|
|
|
|
sleep 5
|
|
|
|
|
2022-11-29 01:37:45 +03:00
|
|
|
echo Killing OSD 1
|
2022-05-21 10:08:08 +03:00
|
|
|
kill -9 $OSD1_PID
|
|
|
|
$ETCDCTL del /vitastor/osd/state/1
|
|
|
|
|
2023-10-04 01:01:36 +03:00
|
|
|
for i in $(seq 2 $OSD_COUNT); do
|
2022-05-21 10:08:08 +03:00
|
|
|
sleep 15
|
|
|
|
echo Killing OSD $i and starting OSD $((i-1))
|
|
|
|
p=OSD${i}_PID
|
|
|
|
kill -9 ${!p}
|
|
|
|
$ETCDCTL del /vitastor/osd/state/$i
|
|
|
|
start_osd $((i-1))
|
|
|
|
sleep 15
|
|
|
|
done
|
|
|
|
|
|
|
|
sleep 5
|
2023-10-04 01:01:36 +03:00
|
|
|
echo Starting OSD $OSD_COUNT
|
|
|
|
start_osd $OSD_COUNT
|
2022-05-21 10:08:08 +03:00
|
|
|
|
|
|
|
sleep 5
|
|
|
|
}
|
|
|
|
|
|
|
|
kill_osds &
|
|
|
|
|
|
|
|
LD_PRELOAD="build/src/libfio_vitastor.so" \
|
2023-01-19 02:23:27 +03:00
|
|
|
fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bsrange=4k-128k -blockalign=4k -direct=1 -iodepth=32 -fsync=256 -rw=randrw \
|
2023-06-03 00:49:53 +03:00
|
|
|
-randrepeat=0 -refill_buffers=1 -mirror_file=./testdata/mirror.bin -etcd=$ETCD_URL -image=testimg -loops=10 -runtime=120
|
2022-05-21 10:08:08 +03:00
|
|
|
|
|
|
|
qemu-img convert -S 4096 -p \
|
|
|
|
-f raw "vitastor:etcd_host=127.0.0.1\:$ETCD_PORT/v3:image=testimg" \
|
|
|
|
-O raw ./testdata/read.bin
|
|
|
|
|
2023-06-17 01:18:34 +03:00
|
|
|
if ! diff -q ./testdata/read.bin ./testdata/mirror.bin; then
|
|
|
|
format_error Data lost during self-heal
|
|
|
|
fi
|
2022-05-21 10:08:08 +03:00
|
|
|
|
2023-06-17 01:18:34 +03:00
|
|
|
if grep -qP 'Checksum mismatch|BUG' ./testdata/osd*.log; then
|
|
|
|
format_error Checksum mismatches or BUGs detected during test
|
2023-06-12 02:32:04 +03:00
|
|
|
fi
|
|
|
|
|
2022-05-21 10:08:08 +03:00
|
|
|
format_green OK
|