From 28b0a2597d8d9d90c2bcd60eab228f98b99193da Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 28 Dec 2024 18:56:52 +0300 Subject: [PATCH] Add a test for multiple snapshots in a second pool --- tests/test_snapshot_pool2.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_snapshot_pool2.sh b/tests/test_snapshot_pool2.sh index 2cd97faa..25c6791a 100755 --- a/tests/test_snapshot_pool2.sh +++ b/tests/test_snapshot_pool2.sh @@ -21,7 +21,16 @@ LD_PRELOAD="build/src/client/libfio_vitastor.so" \ fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -buffer_pattern=0xabcd -build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=128k iodepth=4 +# Create a second snapshot - there was a bug where snapshotted reads from another pool +# were working only when the image and the snapshot were modified in the same revision +# (i.e. there was only one snapshot) +build/src/cmd/vitastor-cli --etcd_address $ETCD_URL snap-create testchain@snap2 -p testpool2 + +LD_PRELOAD="build/src/client/libfio_vitastor.so" \ + fio -thread -name=test -ioengine=build/src/client/libfio_vitastor.so -bs=4k -direct=1 -iodepth=4 -end_fsync=1 -rw=randwrite -number_ios=32 \ + -etcd=$ETCD_URL -image=testchain -mirror_file=./testdata/bin/mirror.bin -buffer_pattern=0xabcd + +build/src/cmd/vitastor-cli --etcd_address $ETCD_URL dd iimg=testchain of=./testdata/bin/res.bin bs=128k iodepth=4 --log_level 10 cmp ./testdata/bin/res.bin ./testdata/bin/mirror.bin