Bug #39420 maria deadlock when doing a large insert
Submitted: 12 Sep 2008 11:58 Modified: 6 Nov 2008 18:05
Reporter: Vemund Østgaard Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Maria storage engine Severity:S3 (Non-critical)
Version:6.0.7 OS:Any
Assigned to: Guilhem Bichot CPU Architecture:Any

[12 Sep 2008 11:58] Vemund Østgaard
Description:
Problem is observed when running suite/large_tests after changing engine in the .test file to maria.

The test inserts larger and larger chunks of data into the same table, doing repeatedly: "insert into t1 select * from t1". After about 15 minutes of this, the test has reached an insert of about 67 million records (and the current size of the table is also 67 million records). At around this point in the test activity on the server seemed to slow down. I connected to mysqld with mysql client and did a "select count(*) from t1;", which returned and showed me there were 67 million rows in the table. A little while later I issued the same query again, but this time it did not return an answer and has now been hanging like that for 15+ hours. The test is also hanging at the same insert statement.

The problem has been observed repeatedly and seemes 100% reproducible.

The stacktrace of all the threads proved too long for the description field and will be attached after the bug has been created. 

How to repeat:
Run suite/large_tests after changing engine in the .test file to maria.
[12 Sep 2008 11:58] Vemund Østgaard
Stacktrace from all threads

Attachment: threaddump (application/octet-stream, text), 13.99 KiB.

[12 Sep 2008 12:07] Guilhem Bichot
Excellent, thanks for your report, with stacktrace!!!
I see one thread is waiting somewhere in the "Maria bitmap" code _ma_bitmap_flush_all(), it might be in the family of http://bugs.mysql.com/bug.php?id=39210 .
We will look into this (but unfortunately not before a few days, there is a physical meeting of all MySQL developers next week which will keep us busy).
[18 Sep 2008 6:59] Guilhem Bichot
Note for the team: let's fix bug#39210 first, it is likely to fix this one too.
[23 Sep 2008 20:37] Guilhem Bichot
assigning to me as I'm looking at BUG#39210.
[6 Nov 2008 18:05] Guilhem Bichot
Looks like the fix for BUG#39210 has fixed this one too as I suspected. I just ran the test mentioned here (suite/large_tests/t/alter_table.test with engine=Maria) for 3 hours, it had time to create 134647798 rows (twice 67 million), and didn't hang, and I could do SELECT COUNT(*) fine.
So, I'm closing this with "can't repeat".
The fix for BUG#39210 is in 6.0-main bzr tree and in 6.0.8.