Bug #29648 Falcon crashes server after multiple object drops followed by drop tablespace
Submitted: 9 Jul 2007 13:29 Modified: 13 Jan 2009 12:47
Reporter: Robin Schumacher Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S2 (Serious)
Version:6.0 OS:Microsoft Windows
Assigned to: Sergey Vojtovich CPU Architecture:Any
Tags: F_PAGE IO

[9 Jul 2007 13:29] Robin Schumacher
Description:
Falcon crashes server after you add/drop objects followed by drop tablespace

How to repeat:
mysql> create tablespace gimdata
    -> add datafile 'c:/dev/falcon/gimdata.fts' engine=falcon;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from information_schema.falcon_tables;
+-------------+------------+------------+
| SCHEMA_NAME | TABLE_NAME | TABLESPACE |
+-------------+------------+------------+
| GIMF        | FTEST      | GIMDATA    |
+-------------+------------+------------+

<push 1.8 million rows into ftest>

size is now 175MB

mysql> create table t1 (c1 int) engine=falcon tablespace gimdata;
Query OK, 0 rows affected (0.06 sec)

mysql> insert into t1 values (1);
Query OK, 1 row affected (0.03 sec)

mysql> select * from information_schema.falcon_tables;
+-------------+------------+------------+
| SCHEMA_NAME | TABLE_NAME | TABLESPACE |
+-------------+------------+------------+
| GIMF        | FTEST      | GIMDATA    |
| GIMF        | T1         | GIMDATA    |
+-------------+------------+------------+

mysql> drop table ftest;
Query OK, 0 rows affected (0.05 sec)

mysql> create table ftest like rms2;
Query OK, 0 rows affected (0.05 sec)

mysql> alter table ftest engine=falcon;
Query OK, 0 rows affected (0.17 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> alter table ftest tablespace gimdata;
Query OK, 0 rows affected (0.06 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> select * from information_schema.falcon_tables;
+-------------+------------+------------+
| SCHEMA_NAME | TABLE_NAME | TABLESPACE |
+-------------+------------+------------+
| GIMF        | T1         | GIMDATA    |
| GIMF        | FTEST      | GIMDATA    |
+-------------+------------+------------+

<push 1.8 million rows into ftest>

size is now 348MB

mysql> drop table t1;
Query OK, 0 rows affected (0.02 sec)

mysql> drop table ftest;
Query OK, 0 rows affected (0.08 sec)

mysql> drop tablespace gimdata engine=falcon;

CRASH
[9 Jul 2007 15:03] Calvin Sun
where to get the data file?
[9 Jul 2007 15:53] MySQL Verification Team
Thank you for the bug report.

c:\dev\6.0>bin\mysql -uroot db7
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 6.0.1-alpha-nt Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> drop table t1;
Query OK, 0 rows affected (0.97 sec)

mysql> drop table ftest;
Query OK, 0 rows affected (10.44 sec)

mysql> drop tablespace gimdata engine=falcon;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
[9 Jul 2007 16:05] Calvin Sun
Please see bug#29647 for creation of db7.
[9 Jul 2007 16:06] MySQL Verification Team
Below how to create tablespace and tables for this bug:

c:\dev\6.0>bin\mysqladmin -uroot create db7

c:\dev\6.0>bin\mysql -uroot db7
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 6.0.1-alpha-nt Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create tablespace gimdata
    -> add datafile 'c:/dev/falcon/gimdata.fts' engine=falcon;
Query OK, 0 rows affected (0.13 sec)

mysql> create table ftest (id serial, col1 varchar(500)) engine=falcon tablespace
gimdata;
Query OK, 0 rows affected (0.16 sec)

mysql> insert into ftest values (null,repeat("a",500));
Query OK, 1 row affected (0.01 sec)

mysql> insert into ftest (col1) select col1 from ftest;
Query OK, 1 row affected (0.00 sec)
Records: 1  Duplicates: 0  Warnings: 0

<cut>

mysql> insert into ftest (col1) select col1 from ftest;
Query OK, 524288 rows affected (47.11 sec)
Records: 524288  Duplicates: 0  Warnings: 0

mysql> insert into ftest (col1) select col1 from ftest;
Query OK, 1048576 rows affected (4 min 17.40 sec)
Records: 1048576  Duplicates: 0  Warnings: 0

mysql> select count(*) from ftest;
+----------+
| count(*) |
+----------+
|  2097152 |
+----------+
1 row in set (6 min 58.49 sec)

mysql> create table t1 (c1 int) engine=falcon tablespace gimdata;
Query OK, 0 rows affected (0.47 sec)

mysql> insert into t1 values (1);
Query OK, 1 row affected (0.14 sec)

mysql>  select * from information_schema.falcon_tables;
+-------------+------------+------------+
| SCHEMA_NAME | TABLE_NAME | TABLESPACE |
+-------------+------------+------------+
| DB7         | FTEST      | GIMDATA    |
| DB7         | T1         | GIMDATA    |
+-------------+------------+------------+
2 rows in set (0.09 sec)

mysql>
[11 Jul 2007 14:08] Calvin Sun
According to Robin, this one is fixed.
[23 Apr 2008 13:08] MySQL Verification Team
This still presents the crash on both mysql-6.0 and mysql-6.0-falcon latest
source tree:

mysql> select * from information_schema.falcon_tables;
+-------------+------------+-----------+------------+---------------+
| SCHEMA_NAME | TABLE_NAME | PARTITION | TABLESPACE | INTERNAL_NAME |
+-------------+------------+-----------+------------+---------------+
| DB7         | FTEST      |           | gimdata    | FTEST         |
| DB7         | T1         |           | gimdata    | T1            |
+-------------+------------+-----------+------------+---------------+
2 rows in set (0.14 sec)

mysql> show variables like "%version%";
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| protocol_version        | 10                  |
| version                 | 6.0.6-alpha-nt      |
| version_comment         | Source distribution |
| version_compile_machine | ia32                |
| version_compile_os      | Win32               |
+-------------------------+---------------------+
5 rows in set (1.44 sec)

mysql> drop table t1;
Query OK, 0 rows affected (0.11 sec)

mysql> drop table ftest;
Query OK, 0 rows affected (0.98 sec)

mysql> drop tablespace gimdata engine=falcon;
Query OK, 0 rows affected (0.03 sec)

mysql>

080423  8:48:38 [Note] 6.0\bin\mysqld: ready for connections.
Version: '6.0.6-alpha-nt'  socket: ''  port: 3306  Source distribution
080423  9:06:36 - mysqld got exception 0x80000003 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 337727 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
7C901230    ntdll.dll!DbgBreakPoint()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

C:\dbs>
[23 Apr 2008 16:11] Kevin Lewis
Sergey, can you determine where this is crashing?  maybe suggest a fix?
[23 Apr 2008 17:57] Vladislav Vaintroub
Tried to reproduce error on "drop" and could not. The server crasher earlier in insert/select. I created related Bug#36294, look here for for details.
[13 Jan 2009 12:47] Sergey Vojtovich
Was unable to reproduce initial issue, which seem to be unhandled exception. As there is a test case already covering this bug (falcon_bug_36294-big.test) closing as can't repeat.

Also please note that there were additional bugs discovered with the provided test case. For more information please see BUG#36294 and BUG#36631.