Bug #22141 crash in sysbench oltp read-write test with 1 thread
Submitted: 9 Sep 2006 4:55 Modified: 29 Oct 2008 17:55
Reporter: Georg Richter Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S1 (Critical)
Version:5.2 OS:Any
Assigned to: CPU Architecture:Any
Tags: F_UNKNOWN

[9 Sep 2006 4:55] Georg Richter
Description:
 jstar crashes in benchmark with 1 thread.

 stack:

0x81809dc handle_segfault + 356
0xb74f4d28 _end + -1360222952
0x838a5a2 _ZN6MemMgr5allocEi + 270
0x835cab4 _ZN5Table6updateEP11TransactionijPKh + 344
0x835341f _ZN15StorageDatabase9updateRowEP10ConnectionP5TableijPKhPh + 35
0x8353f8d _ZN12StorageTable9updateRowEijPKhPh + 41
0x827d690 _ZN15NfsStorageTable10update_rowEPKcPc + 52
0x81e47a1 _Z12mysql_updateP3THDP13st_table_listR4ListI4ItemES6_PS4_jP8st_ordery15enum_duplicatesb + 2249
0x8195469 _Z21mysql_execute_commandP3THD + 3681
0x81e19da _ZN18Prepared_statement7executeEP6Stringb + 634
0x81e059c _Z18mysql_stmt_executeP3THDPcj + 300
0x8194027 _Z16dispatch_command19enum_server_commandP3THDPcj + 4927
0x8192cad _Z10do_commandP3THD + 129
0x81921b5 handle_one_connection + 621
0xb74eedec _end + -1360247332
0xb7425e8a _end + -1361070470

thd->query at 0x8fca690 = UPDATE sbtest set c=? where id=?
thd->thread_id=359

How to repeat:
1. prepare table with 1000000 rows:
./sysbench --test=oltp --mysql-engine-trx=jstar --oltp-table-size=1000000 --mysql-engine-trx=yes --oltp-table-name=sbtest --init-rng=on --mysql-db=test prepare

2. run oltp-read-write benchmark:
./sysbench --test=oltp --mysql-engine-trx=jstar --oltp-table-size=1000000 --mysql-engine-trx=yes --oltp-table-name=sbtest --oltp-test-mode=complex --oltp-read-only=off --oltp-dist-type=special --max-requests=0 --num-threads=1 --init-rng=on --mysql-db=test --max-time=180 ru
[12 Sep 2006 20:05] Jim Starkey
Alas and alack, I've tried this three times in a row against the same server and, ta da, no crash.

Perhaps we've accidentally fixed this?  Maybe?  Maybe?

If anyone can reproduce this bug, I'd like to hear about it.
[12 Sep 2006 23:46] Calvin Sun
bug#22148 is related, which uses 256 threads.
[15 Sep 2006 13:41] Hakan Küçükyılmaz
Tried to verify on Linux 64-bit with change set 1.2292, 2006-09-14.

Step 1 in bug report cannot work:
1. prepare table with 1000000 rows:
./sysbench --test=oltp --mysql-engine-trx=jstar --oltp-table-size=1000000
--mysql-engine-trx=yes --oltp-table-name=sbtest --init-rng=on --mysql-db=test
prepare

The paramter 
  --mysql-engine-trx=jstar 
can be either yes or no. 

Probably it should be
  --mysql-table-engine=falcon
If --mysql-table-engine is not set, than the default storage engine will be set.

I tried the first step like:
sysbench --test=oltp --mysql-user=root --mysql-table-engine=falcon --oltp-table-size=1000000 --mysql-engine-trx=yes --oltp-table-name=sbtest --init-rng=on --mysql-db=test prepare

We can verify step one with:
mysql> show create table sbtest\G
*************************** 1. row ***************************
       Table: sbtest
Create Table: CREATE TABLE "sbtest" (
  "id" int(10) unsigned NOT NULL AUTO_INCREMENT,
  "k" int(10) unsigned NOT NULL DEFAULT '0',
  "c" char(120) NOT NULL DEFAULT '',
  "pad" char(60) NOT NULL DEFAULT '',
  PRIMARY KEY ("id"),
  KEY "k" ("k")
) ENGINE=Falcon DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

mysql> select count(*) from sbtest;
+----------+
| count(*) |
+----------+
|  1000000 |
+----------+
1 row in set (3.77 sec)

Step 2:
In step two we see
  --mysql-engine-trx=jstar
which is wrong. I replaced it with --mysql-table-engine=falcon

I run step 2 like:
sysbench --test=oltp --mysql-user=root --mysql-table-engine=falcon --mysql-engine-trx=yes --oltp-table-size=1000000 --oltp-table-name=sbtest --oltp-test-mode=complex --oltp-read-only=off --oltp-dist-type=special --max-requests=0 --num-threads=1 --init-rng=on --mysql-db=test --max-time=180 run

which ends in:
sysbench v0.4.7:  multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
WARNING: Preparing of "BEGIN" is unsupported, using emulation
Running the test with following options:
Number of threads: 1
Initializing random number generator from timer.

Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations,  1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
ALERT: failed to execute mysql_stmt_execute(): Err1062 Duplicate entry '502392' for key 'PRIMARY'
FATAL: database error, exiting...
Done.

Important note: Step 1 hangs if storage engine InnoDB is activated, after putting skip-innodb into my.cnf I was able to run step 1 successfully.

Regards, Hakan
[15 Oct 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 Oct 2008 17:55] Hakan Küçükyılmaz
I could successfully run several sysbench tests with 1 million rows with latest Falcon code and sysbench v0.5.