From e600bbc1515fa1a459b1de32f2d365847180d6c4 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 30 Dec 2023 14:54:17 +0300 Subject: [PATCH] Fix flapping move_reappear test by adding an fsync before stopping PG --- tests/test_move_reappear.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_move_reappear.sh b/tests/test_move_reappear.sh index e8b949bd..fa250d37 100755 --- a/tests/test_move_reappear.sh +++ b/tests/test_move_reappear.sh @@ -7,7 +7,7 @@ OSD_COUNT=5 OSD_ARGS="$OSD_ARGS" for i in $(seq 1 $OSD_COUNT); do dd if=/dev/zero of=./testdata/test_osd$i.bin bs=1024 count=1 seek=$((OSD_SIZE*1024-1)) - build/src/vitastor-osd --osd_num $i --bind_address 127.0.0.1 --etcd_stats_interval 5 $OSD_ARGS --etcd_address $ETCD_URL $(build/src/vitastor-disk simple-offsets --format options ./testdata/test_osd$i.bin 2>/dev/null) >>./testdata/osd$i.log 2>&1 & + build/src/vitastor-osd --log_level 10 --osd_num $i --bind_address 127.0.0.1 --etcd_stats_interval 5 $OSD_ARGS --etcd_address $ETCD_URL $(build/src/vitastor-disk simple-offsets --format options ./testdata/test_osd$i.bin 2>/dev/null) >>./testdata/osd$i.log 2>&1 & eval OSD${i}_PID=$! done @@ -53,6 +53,11 @@ for i in {1..30}; do fi done +# Sync so all moved objects are removed from OSD 1 (they aren't removed without a sync) +LD_PRELOAD="build/src/libfio_vitastor.so" \ +fio -thread -name=test -ioengine=build/src/libfio_vitastor.so -bs=4k -direct=1 -iodepth=1 -fsync=1 -number_ios=2 -rw=write \ + -etcd=$ETCD_URL -pool=1 -inode=2 -size=32M -cluster_log_level=10 + $ETCDCTL put /vitastor/config/pgs '{"items":{"1":{"1":{"osd_set":[4,5],"primary":0}}}}' $ETCDCTL put /vitastor/pg/history/1/1 '{"all_peers":[1,2,3]}'