Bug #22845 Falcon: hang on partition drop
Submitted: 29 Sep 2006 23:57 Modified: 14 Jun 2007 1:50
Reporter: Peter Gulutzan
Status: Can't repeat
Category:Server: Falcon Severity:S3 (Non-critical)
Version:5.1.12-beta-debug OS:Linux (SUSE 10.0 / 64-bit)
Assigned to: Target Version:

[29 Sep 2006 23:57] Peter Gulutzan
Description:
I have two connections running transactions, call them T1 and T2.

On T1, I create a partitioned table.

On T2, I insert into the table.

On T1, I try to drop the partition which T2 has changed. Error message. Okay.

On T1, I try again to drop the partition.

Hang.

How to repeat:
On T1, say:
create database d12;
use d12
set @@autocommit=0;
create table t9 (s1 int)
engine=falcon
partition by list (s1)
(partition p1 values in (1),
 partition p2 values in (2),
 partition p3 values in (null));
start transaction;

On T2, say:
use d12
set @@autocommit=0;
start transaction;
insert into t9 values (2);

On T1, say:
alter table t9 drop partition p2;          /* Error message */
alter table t9 drop partition p2;          /* Hang */

On T2, say "commit" or rollback" if you like -- it won't help.
[4 Oct 2006 7:38] Hakan Kuecuekyilmaz
Tested on Linux 32-bit, change set 1.2364, 2006-10-03 

[07:34] root@d12>alter table t9 drop partition p2;
ERROR 1296 (HY000): Got error 156 'table D12.T9#P#P2 has uncommitted updates and can't be
dropped' from Falcon

This is intended behaviour of Falcon.

Try with:
T1:
create database d12;
use d12
set @@autocommit=0;
create table t9 (s1 int)
engine=falcon
partition by list (s1)
(partition p1 values in (1),
 partition p2 values in (2),
 partition p3 values in (null));
start transaction;

T2:
use d12
set @@autocommit=0;
start transaction;
insert into t9 values (2);
COMMIT;

T1:
alter table t9 drop partition p2;  

[07:42] root@d12>alter table t9 drop partition p2;
Query OK, 0 rows affected (0.22 sec)
Records: 0  Duplicates: 0  Warnings: 0

Regards, Hakan
[5 Oct 2006 17:53] Hakan Kuecuekyilmaz
Please note the COMMIT on T2:

insert into t9 values (2);
COMMIT;

Background: In Falcon one cannot drop objects with pending transactions.

Regards, Hakan
[5 Oct 2006 19:34] Hakan Kuecuekyilmaz
Verified on Linux 32-bit, change set 1.2368, 2006-10-04.

A COMMIT on T2 does not help. T1 hangs. Reproduced like:

T1, say:
create database d12;
use d12
set @@autocommit=0;
create table t9 (s1 int)
engine=falcon
partition by list (s1)
(partition p1 values in (1),
 partition p2 values in (2),
 partition p3 values in (null));
start transaction;

T2, say:
use d12
set @@autocommit=0;
start transaction;
insert into t9 values (2);

T1, say:
alter table t9 drop partition p2;
[19:33] root@d12>alter table t9 drop partition p2;
ERROR 1296 (HY000): Got error 156 'table D12.T9#P#P2 has uncommitted updates and can't be
dropped' from Falcon

T2, say:
COMMIT;

T1, say:
alter table t9 drop partition p2;
-- hang

CPU usage goes up to 100%

Regards, Hakan
[20 Oct 2006 11:48] Hakan Kuecuekyilmaz
I tried it with InnoDB and it works. With Falcon it still hangs. Added test case
falcon_bug_22845.test

Regards, Hakan
[14 Jun 2007 1:50] Calvin Sun
can not reproduce it with a recent binary. The connection 1 returns error for second alter
table:

mysql> alter table t9 drop partition p2;
ERROR 1015 (HY000): Can't lock file (errno: 212)
mysql> alter table t9 drop partition p2;
ERROR 1015 (HY000): Can't lock file (errno: 212)