Bug #29518 Apparent memory leak when executing ALTER TABLE... TABLESPACE in Falcon
Submitted: 3 Jul 2007 13:38 Modified: 26 Sep 2008 14:29
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:Windows
Assigned to: CPU Architecture:Any
Tags: cwp

[3 Jul 2007 13:38] Robin Schumacher
Description:
Memory leak appears to occur when doing an ALTER TABLE ... TABLESPACE <new tablespace> for large Falcon table

How to repeat:
Create two tablespaces.
Create table with one million rows in it and put it in 1st tablespace.
Issue an ALTER TABLE and put large table in 2nd tablespace.
Observe memory usage

I had a 100MB page and record cache and the mysqld usage went to 1GB on my WINXP box after the ALTER TABLE was finished.
[4 Jul 2007 14:50] MySQL Verification Team
Thank you for the bug report.

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

c:\dev\6.0>bin\mysql -uroot db3
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 gimfdata1
    -> add datafile 'c:/dev/gimf1.fts'
    -> engine=falcon;
Query OK, 0 rows affected (0.16 sec)

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

mysql>
mysql> create table tb1 (id serial, col1 char(20))
    -> tablespace gimfdata1 engine=falcon;
Query OK, 0 rows affected (0.09 sec)

mysql> insert into tb1 values (NULL,repeat("test",5));
Query OK, 1 row affected (0.00 sec)

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

.....

mysql> insert into tb1 (col1) select col1 from tb1;
Query OK, 262144 rows affected (6.57 sec)
Records: 262144  Duplicates: 0  Warnings: 0

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

mysql> insert into tb1 (col1) select col1 from tb1;
Query OK, 1048576 rows affected (28.31 sec)
Records: 1048576  Duplicates: 0  Warnings: 0

mysql> select count(*) from tb1;
+----------+
| count(*) |
+----------+
|  2097152 |
+----------+
1 row in set (6.80 sec)

mysql> alter table tb1 tablespace gimfdata2 engine=falcon;
Query OK, 2097152 rows affected (1 min 13.44 sec)
Records: 2097152  Duplicates: 0  Warnings: 0
[19 Sep 2007 14:09] Hakan Küçükyılmaz
Robin,

with your described configuration we get a 'record memory is exhausted' error while trying to load the data.

Other than that the 
   alter table tb1 tablespace gimfdata2 engine=falcon; 

runs without any significant increase of memory usage.

6.0.3-alpha-debug
[16:05] root@test>insert into tb1 (col1) select col1 from tb1;
Query OK, 262144 rows affected (11.19 sec)
Records: 262144  Duplicates: 0  Warnings: 0

6.0.3-alpha-debug
[16:05] root@test>insert into tb1 (col1) select col1 from tb1;
ERROR 1296 (HY000): Got error 305 'record memory is exhausted' from Falcon
6.0.3-alpha-debug
[19 Oct 2007 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".