Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpcc of sqlite does not work with multithreaded mode #75

Open
lijianan98 opened this issue Nov 21, 2022 · 0 comments
Open

tpcc of sqlite does not work with multithreaded mode #75

lijianan98 opened this issue Nov 21, 2022 · 0 comments

Comments

@lijianan98
Copy link

Hi, I ported your implementation of tpcc benchmark for sqlite.
Firstly I tested the benchmark by loading with warehouse number = 4 as below:
./build-release/tpcc_load -w 4 -d tpcc.db
The code compiles and runs with no problems when I set database connection to be 1 like below:
./tpcc_start -w 4 -c 1 -t 2000 -d tpcc.db.

However, when I set the database connection to be 2 like below:
./tpcc_start -w 4 -c 2 -t 2000 -d tpcc.db.
There will occur constraint error:

CHECKING IF SQLITE IS THREADSAFE: RETURN VALUE = 1
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
option w with value '4'
option c with value '2'
option t (number of transactions) with value '2000'
option d with value 'tpcc.db'
<Parameters>
  [warehouse]: 4
 [connection]: 2
     [rampup]: 10 (sec.)
    [measure]: 20 (sec.)
RAMP-UP TIME.(10 sec.)
thread_main: opening db, thread id = 140629658339072
thread_main: opening db, thread id = 140629649946368
thread_main: opened db, thread id = 140629658339072
thread_main: opened db, thread id = 140629649946368
neword 0:4
neword: error: UNIQUE constraint failed: orders.o_id, orders.o_d_id, orders.o_w_id
neword 0:4
neword: error: UNIQUE constraint failed: orders.o_id, orders.o_d_id, orders.o_w_id
neword 0:4
neword: error: UNIQUE constraint failed: orders.o_id, orders.o_d_id, orders.o_w_id
....
error at thread_main
thread_main: error: cannot commit - no transaction is active

Thank you so much and I really appreciate any idea about possible reasons of what is happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant