featurebase/qa/testcases/bug-repros/fb-1332.sh
2022-09-02 13:23:39 -07:00

36 lines
922 B
Bash
Executable file

#!/bin/bash
# datagen some timestamps onto DATANODE0 in index fb_1332_test
/data/datagen_linux_arm64 -s custom --custom-config=./fb-1332-datagen.yaml --pilosa.index=fb1332 --pilosa.batch-size=100 --pilosa.hosts=$1
if (( $? != 0 )); then
echo "couldn't datagen"
exit 1
fi
# take a backup
featurebase backup --host=$1 -o=fb1332.bak --index=fb1332
if (( $? != 0 )); then
echo "couldn't backup"
exit 1
fi
# delete that index
if [[ $( curl -XDELETE $1/index/fb1332| jq '.error' ) != "null" ]]; then
echo "couldn't delete index"
exit 1
fi
# fb restore
featurebase restore --host=$1 -s=fb1332.bak
if (( $? != 0 )); then
echo "couldn't restore"
exit 1
fi
# datagen some more
/data/datagen_linux_arm64 -s custom --custom-config=./fb-1332-datagen.yaml --pilosa.index=fb1332 --pilosa.batch-size=100 --pilosa.hosts=$1
if (( $? != 0 )); then
echo "couldn't ingest a second time"
exit 1
fi