sysbench icon indicating copy to clipboard operation
sysbench copied to clipboard

Table 'sbtest1' already exists

Open maiermic opened this issue 4 years ago • 0 comments

I try to benchmark MySQL in Docker. I tried the Docker Image severalnines/sysbench, which installs sysbench in a Debian environment like this

Dockerfile

FROM debian:latest
MAINTAINER Severalnines <[email protected]>

RUN apt-get update && \
        apt-get -y install curl

RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | bash

RUN apt-get -y install sysbench git make gcc unzip wget lua5.1 lua5.1-dev && \
        apt-get clean

RUN wget https://luarocks.org/releases/luarocks-2.4.3.tar.gz && tar zxpf luarocks-2.4.3.tar.gz && cd luarocks-2.4.3 && ./configure && make bootstrap

I run

docker network create my-net

docker run \
  --name mysql \
  --network my-net \
  --rm \
  -e MYSQL_ALLOW_EMPTY_PASSWORD='1' \
  -e MYSQL_DATABASE=sbtest \
  -e MYSQL_USER=sbtest \
  -e MYSQL_PASSWORD=password \
  -p 3306:3306 \
  -d mysql:5.7

docker run \
  --network my-net \
  --name=sb-prepare \
  --rm \
  severalnines/sysbench \
  sysbench \
  --db-driver=mysql \
  --oltp-table-size=100 \
  --oltp-tables-count=24 \
  --threads=1 \
  --mysql-host=mysql \
  --mysql-port=3306 \
  --mysql-user=sbtest \
  --mysql-password=password \
  /usr/share/sysbench/tests/include/oltp_legacy/parallel_prepare.lua \
  run

and get the sysbench output

sysbench 1.0.17 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Initializing worker threads...

Threads started!

thread prepare0
Creating table 'sbtest1'...
Inserting 100 records into 'sbtest1'
Creating secondary indexes on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 100 records into 'sbtest2'
Creating secondary indexes on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 100 records into 'sbtest3'
Creating secondary indexes on 'sbtest3'...
Creating table 'sbtest4'...
Inserting 100 records into 'sbtest4'
Creating secondary indexes on 'sbtest4'...
Creating table 'sbtest5'...
Inserting 100 records into 'sbtest5'
Creating secondary indexes on 'sbtest5'...
Creating table 'sbtest6'...
Inserting 100 records into 'sbtest6'
Creating secondary indexes on 'sbtest6'...
Creating table 'sbtest7'...
Inserting 100 records into 'sbtest7'
Creating secondary indexes on 'sbtest7'...
Creating table 'sbtest8'...
Inserting 100 records into 'sbtest8'
Creating secondary indexes on 'sbtest8'...
Creating table 'sbtest9'...
Inserting 100 records into 'sbtest9'
Creating secondary indexes on 'sbtest9'...
Creating table 'sbtest10'...
Inserting 100 records into 'sbtest10'
Creating secondary indexes on 'sbtest10'...
Creating table 'sbtest11'...
Inserting 100 records into 'sbtest11'
Creating secondary indexes on 'sbtest11'...
Creating table 'sbtest12'...
Inserting 100 records into 'sbtest12'
Creating secondary indexes on 'sbtest12'...
Creating table 'sbtest13'...
Inserting 100 records into 'sbtest13'
Creating secondary indexes on 'sbtest13'...
Creating table 'sbtest14'...
Inserting 100 records into 'sbtest14'
Creating secondary indexes on 'sbtest14'...
Creating table 'sbtest15'...
Inserting 100 records into 'sbtest15'
Creating secondary indexes on 'sbtest15'...
Creating table 'sbtest16'...
Inserting 100 records into 'sbtest16'
Creating secondary indexes on 'sbtest16'...
Creating table 'sbtest17'...
Inserting 100 records into 'sbtest17'
Creating secondary indexes on 'sbtest17'...
Creating table 'sbtest18'...
Inserting 100 records into 'sbtest18'
Creating secondary indexes on 'sbtest18'...
Creating table 'sbtest19'...
Inserting 100 records into 'sbtest19'
Creating secondary indexes on 'sbtest19'...
Creating table 'sbtest20'...
Inserting 100 records into 'sbtest20'
Creating secondary indexes on 'sbtest20'...
Creating table 'sbtest21'...
Inserting 100 records into 'sbtest21'
Creating secondary indexes on 'sbtest21'...
Creating table 'sbtest22'...
Inserting 100 records into 'sbtest22'
Creating secondary indexes on 'sbtest22'...
Creating table 'sbtest23'...
Inserting 100 records into 'sbtest23'
Creating secondary indexes on 'sbtest23'...
Creating table 'sbtest24'...
Inserting 100 records into 'sbtest24'
Creating secondary indexes on 'sbtest24'...
thread prepare0
Creating table 'sbtest1'...
FATAL: mysql_drv_query() returned error 1050 (Table 'sbtest1' already exists) for query 'CREATE TABLE sbtest1 (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
k INTEGER UNSIGNED DEFAULT '0' NOT NULL,
c CHAR(120) DEFAULT '' NOT NULL,
pad CHAR(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
) /*! ENGINE = innodb MAX_ROWS = 1000000 */ '
FATAL: `thread_run' function failed: /usr/share/sysbench/tests/include/oltp_legacy/common.lua:66: db_query() failed
Error in my_thread_global_end(): 1 threads didn't exit

If I rebuild the Docker image, sysbench version 1.0.20 is installed, but I get the same error.


The example is from the description of the Docker Image severalnines/sysbench.

maiermic avatar Sep 05 '20 15:09 maiermic