Fix change_pg_count test (statistic reporting may take some time)

nfs-proxy-old
Vitaliy Filippov 2022-04-08 11:58:53 +03:00
parent 83146fa3e2
commit 0eb929f1ba
1 changed files with 10 additions and 1 deletions

View File

@ -78,7 +78,16 @@ try_change()
fi
# Check that no objects are lost !
# But note that reporting this information may take up to <etcd_report_interval+1> seconds
nobj=0
waittime=0
while [[ $nobj -ne $NOBJ && $waittime -lt 7 ]]; do
nobj=`$ETCDCTL get --prefix '/vitastor/pg/stats' --print-value-only | jq -s '[ .[].object_count ] | reduce .[] as $num (0; .+$num)'`
if [[ $nobj -ne $NOBJ ]]; then
waittime=$((waittime+1))
sleep 1
fi
done
if [ "$nobj" -ne $NOBJ ]; then
format_error "Data lost after changing PG count to $n: $NOBJ objects expected, but got $nobj"
fi