timescale / tsbs

Time Series Benchmark Suite, a tool for comparing and evaluating databases for time series data
MIT License
1.24k stars 291 forks source link

tsbs_load load timescaledb error #248

Open ruoshui9527 opened 3 months ago

ruoshui9527 commented 3 months ago

tsbs_generate_data --use-case="iot" --seed=123 --scale=4000 \ --timestamp-start="2024-03-10T00:00:00Z" \ --timestamp-end="2024-03-12T00:00:00Z" \ --log-interval="10s" --format="timescaledb" \ | gzip > /tmp/timescaledb-data.gz

use tsbs_load:

./tsbs_load config --target=timescaledb --data-source=FILE

vi After modifying the relevant content, execute ./tsbs_load load timescaledb --config=./config.yaml Using config file: ./config.yaml 2024/03/12 11:50:22 input header in wrong format. got '%!s(uint8=31)', expected 'tags'

use tsbs_load_timescaledb:

cat /tmp/timescaledb-data.gz | gunzip | ./tsbs_load_timescaledb \

--postgres="sslmode=disable" --host="192.168.1.10" --port=5433 --pass="111111" \ --user="postgres" --admin-db-name=tsbs --workers=8 \ --in-table-partition-tag=true --chunk-time=8h --write-profile= \ --field-index-count=1 --do-create-db=true --force-text-format=false \ --do-abort-on-exist=false --create-metrics-table=true could not execute sql: SELECT create_hypertable('readings'::regclass, 'time'::name, replication_factor => NULL, chunk_time_interval => 28800000000, create_defe_hypertable(regclass, name, replication_factor => unknown, chunk_time_interval => bigint, create_default_indexes => boolean) does not exist (SQLSTATE 42883)

goroutine 1 [running]: github.com/timescale/tsbs/pkg/targets/timescaledb.MustExec(0x8d8971?, {0xc0000e6000, 0x9b}, {0x0?, 0x4?, 0x8?}) /home/ps/tsbs-master/pkg/targets/timescaledb/creator.go:296 +0xd0 github.com/timescale/tsbs/pkg/targets/timescaledb.(dbCreator).createTableAndIndexes(0xc00008a0f0, 0xc000128dd0, {0xc000178140, 0x8}, {0xc00016a280, 0x8, 0x8} /home/ps/tsbs-master/pkg/targets/timescaledb/creator.go:224 +0x6ff github.com/timescale/tsbs/pkg/targets/timescaledb.(dbCreator).PostCreateDB(0xc00008a0f0, {0x8bc0b4?, 0x9?}) /home/ps/tsbs-master/pkg/targets/timescaledb/creator.go:105 +0x365 github.com/timescale/tsbs/load.(CommonBenchmarkRunner).useDBCreator(0xc000122790, {0x971cf8, 0xc00008a0f0}) /home/ps/tsbs-master/load/loader.go:252 +0x215 github.com/timescale/tsbs/load.(CommonBenchmarkRunner).preRun(0xc000122790, {0x972660, 0xc00068e000}) /home/ps/tsbs-master/load/loader.go:128 +0x72 github.com/timescale/tsbs/load.(*CommonBenchmarkRunner).RunBenchmark(0xc000122790, {0x972660, 0xc00068e000}) /home/ps/tsbs-master/load/loader.go:184 +0x37 main.main() /home/ps/tsbs-master/cmd/tsbs_load_timescaledb/main.go:102 +0x213

moaazassali commented 2 months ago

I am getting the same error input header in wrong format. got '%!s(uint8=31)', expected 'tags'. Did you find a solution?

Koheiru commented 1 month ago

There are two different issues described.

The first one is like a feature =) It is about that tsbs_load tool couldn't read compressed file with metrics. Error message input header in wrong format. got '%!s(uint8=31)', expected 'tags' is a marker of this issue. So, you can do one of the following:

The second issue is critical and there is no workaround but I've already create fix for this issue (check #255). So, you can merge my fix or just use older version of timescaledb.