Deadlock on simultaneous TRUNCATE and SELECT FROM information_schema

Bug #903617 reported by wojtek
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Sergei Glushchenko
5.1
Fix Released
High
Sergei Glushchenko

Bug Description

Hello,

We are having trouble with servers suspending (sometimes crashing) when a TRUNCATE TABLE is done together
with selecting data over same table from information_schema.
When suspended no query is executed, it is not possible to shutdown the server. The only solution is kill -9.

We are also experiencing it in production.

To reproduce:
 CREATE DATABASE IF NOT EXISTS testdb;
 use testdb;
 DROP TABLE IF EXISTS test;
 CREATE TABLE test (
         id INTEGER,
         text VARCHAR(60)
 )ENGINE InnoDB;

 --------
 #!/bin/bash

 for i in $(seq 1 100); do
        mysql testdb -e 'TRUNCATE TABLE test' & # <---- note the &
        mysql information_schema -e 'SELECT * FROM tables WHERE table_schema="testdb" AND table_name="test"';
 done

Server version: 5.1.59-rel13.0-log from Percona downloads
OS: Debian Squeeze amd64

Related branches

Revision history for this message
yinfeng (yinfeng-zwx) wrote :

cant't repeat in Percona-Server-5.5.18-rel23.0

Revision history for this message
wojtek (vojtekb) wrote :

5.1.60-rel13.1 is affected
Would it be possible to fix this in 5.1 series?
It is actually quite serious as it causes db crashes on standard actions in certain webapplications (all sorts of 'Clean X' buttons which launch TRUNCATE TABLE).

Stewart Smith (stewart)
Changed in percona-server:
importance: Undecided → High
Changed in percona-server:
assignee: nobody → Sergei Glushchenko (sergei.glushchenko)
Changed in percona-server:
status: New → In Progress
Changed in percona-server:
status: In Progress → Fix Committed
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Thank you for reporting this bug. Fix will be released in next PS 5.1release (Percona Server 5.1.62-13.3).

Changed in percona-server:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-524

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.