Percona-Lab/sysbench-tpcc

function failed: ./tpcc_common.lua:526: db_bulk_insert_next() failed

ingardm opened this issue · 5 comments

ubuntu bionic percona server 5.6 latest

16:06:38 [root@db-143[DP]:~/sysbench-tpcc-master] $ ./tpcc.lua --mysql-socket=/var/run/mysqld/mysqld.sock --mysql-user=root --mysql-password=xxxxx --mysql-port=3306 --mysql-db=sbt --time=300 -
-threads=64 --report-interval=1 --tables=10 --scale=100 --db-driver=mysql prepare
sysbench 1.0.19 (using bundled LuaJIT 2.1.0-beta2)

results after same time with:
FATAL: `sysbench.cmdline.call_command' function failed: ./tpcc_common.lua:526: db_bulk_insert_next() failed

However running it with the following doesnt end with an error:
16:12:43 [root@db-143[DP]:~/sysbench-tpcc-master] $ ./tpcc.lua --mysql-socket=/var/run/mysqld/mysqld.sock --mysql-user=root --mysql-password=xxxxxx --mysql-port=3306 --mysql-db=sbt --time=300 -
-threads=64 --report-interval=1 --tables=1 --scale=1 --db-driver=mysql prepare

... but the run cmd crashes instantly:
16:13:41 [root@db-143[DP]:~/sysbench-tpcc-master] $ ./tpcc.lua --mysql-socket=/var/run/mysqld/mysqld.sock --mysql-user=root --mysql-password=xxxxx --mysql-port=3306 --mysql-db=sbt --time=300 -
-threads=64 --report-interval=1 --tables=1 --scale=1 --db-driver=mysql run
sysbench 1.0.19 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 64
Report intermediate results every 1 second(s)
Initializing random number generator from current time

Initializing worker threads...

Threads started!

FATAL: thread_run' function failed: ./tpcc_run.lua:115: attempt to perform arithmetic on local 'd_next_o_id' (a nil value) ALERT: attempt to fetch row from an empty result set FATAL: thread_run' function failed: ./tpcc_run.lua:466: attempt to index global 'row' (a nil value)
FATAL: thread_run' function failed: ./tpcc_run.lua:115: attempt to perform arithmetic on local 'd_next_o_id' (a nil value) (last message repeated 2 times) FATAL: thread_run' function failed: ./tpcc_run.lua:353: attempt to perform arithmetic on a nil value
FATAL: `thread_run' function failed: ./tpcc_run.lua:115: attempt to perform arithmetic on local 'd_next_o_id' (a nil value)

did you resolve this?

@ingardm

I’m experiencing the same issue

My solution is changing command options ‘—time’ value
like from --time=300 to --time=1000

This error happens “db connection closed" still waiting many queries.

So, we could deal with enough total execution time through command option ‘time’ or

being sufficient for the data transfer to complete queries through server system variables. This is reference about server system variables.
https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html

Also,
FATAL: thread_run' function failed: ./tpcc_run.lua:115: attempt to perform arithmetic on local 'd_next_o_id' (a nil value) ALERT: attempt to fetch row from an empty result set FATAL:

happens when data is not loaded properly. because It says “empty set”. There are no records that match SELECT clause.

So, definitely finish the previous step “prepare data and table” without any error message. Then, it will be fine :)

yeah, if anyone is having this issue, make sure your command options are as same as the prepare stage, and set the time big enough.

@seungwonlee0603
Why is the time parameter relevant to receiving an error or not? Maybe I'm missing something but I'd expect any length of time to work

I just faced this error myself.
The reason was long running transactions, it should be fixed by setting con:query("SET autocommit=1") when loading data