Bug #28178 Falcon ALTER TABLE ends up in "Unknown table 'sql-xyz'
Submitted: 1 May 2007 9:31 Modified: 26 May 2010 17:46
Reporter: Hakan Küçükyılmaz Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0.0-alpha OS:Any
Assigned to: Christopher Powers CPU Architecture:Any
Tags: F_ONLINE ALTER

[1 May 2007 9:31] Hakan Küçükyılmaz
Description:
Running ALTER TABLE concurrently gives "Unknown table 'sql-xyz'" error where xyz is a different number on each run.

How to repeat:
Run falcon_bug_22165

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

falcon_bug_22165               [ fail ]

ERROR: Bug#22165 2006-08-24 hakank (Get pushbuild green)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/falcon_bug_22165.result   2007-05-01 12:25:24.000000000 +0300
--- r/falcon_bug_22165.reject   2007-05-01 12:26:39.000000000 +0300
***************
*** 32,34 ****
--- 32,36 ----
  DROP EVENT db1.e2//
  DROP PROCEDURE db1.p1//
  DROP DATABASE db1//
+ Warnings:
+ Note  1051    Unknown table '#sql-1457_7a'
-------------------------------------------------------
[2 May 2007 12:54] Hakan Küçükyılmaz
./mysql-test-run.pl --enable-disabled falcon_bug_22165
[2 May 2007 12:58] MySQL Verification Team
Thank you for the bug report. Verified as described.

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

falcon_bug_22165               [ fail ]
[8 Jun 2007 19:25] Kevin Lewis
I just pushed a change which catches and prevents multiple slater table statements from occurring at the same time on the same table.  These two stored procedures that try to do that may conflict inside MySQL, but they no longer run concurrently inside Falcon.

Falcon returns an error code to the server which is converted to something like this;
ERROR 1015 (HY000): Can't lock file (errno: 156)
But as I ran it on Windows, the stored procedure kept hitting as assert at sql_parse.cc, line 3826;
          DBUG_ASSERT(thd->net.report_error == 1 || thd->killed);
I will need a server expert to determine if this assert is correct or incorrect.
[15 Jun 2007 7:16] Kevin Lewis
The previous change caused some regressions, so it was backed out.  Upon further inspection, I found that the alterIsActive boolean was not initialized, so most alter statements were rejected.  I just pushed the changeset again, tested on pushbuild.  

So now, concurrent alter statements on the same table cannot occur.  The second is rejected with an error.

Unfortunately, the error is "ERROR 1051 (42S02): Unknown table 't1'".  See bug#22972 for this wrong error code.
[29 Aug 2007 19:29] Hakan Küçükyılmaz
The testcase falcon_bug_22165.txt occasionally fails on Linux 32-bit. It does not fail on Linux 64-bit.
[19 Sep 2007 12:49] Hakan Küçükyılmaz
Still failing from time to time on Linux 32-bit.

main.falcon_bug_22165          [ fail ]

ERROR: Bug#22165 2006-08-24 hakank (Get pushbuild green)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** /home/hakan/work/mysql/mysql-5.1-falcon/mysql-test/r/falcon_bug_22165.result	Tue May  1 12:32:39 2007
--- /home/hakan/work/mysql/mysql-5.1-falcon/mysql-test/r/falcon_bug_22165.reject	Fri Sep 14 08:00:37 2007
***************
*** 32,34 ****
--- 32,36 ----
  DROP EVENT db1.e2//
  DROP PROCEDURE db1.p1//
  DROP DATABASE db1//
+ Warnings:
+ Note	1051	Unknown table '#sql-60a9_18'
-------------------------------------------------------
Please follow the instructions outlined at
http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html
to find the reason to this problem and how to report this.
[20 Nov 2007 1:06] Hakan Küçükyılmaz
Still failing on Linux 32-bit:

hakan@lu0008:~/work/mysql/mysql-6.0-falcon/mysql-test> time ./mysql-test-run.pl --force --enable-disabled --suite=falcon falcon_bug_22165
Logging: ./mysql-test-run.pl --force --enable-disabled --suite=falcon falcon_bug_22165

...
...
...

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

falcon.falcon_bug_22165        [ fail ]

--- /home/hakan/work/mysql/mysql-6.0-falcon/mysql-test/suite/falcon/r/falcon_bug_22165.result   2007-09-20 18:42:57.000000000 +0300
+++ /home/hakan/work/mysql/mysql-6.0-falcon/mysql-test/suite/falcon/r/falcon_bug_22165.reject   2007-11-20 04:11:30.000000000 +0300
@@ -32,3 +32,5 @@
 DROP EVENT db1.e2//
 DROP PROCEDURE db1.p1//
 DROP DATABASE db1//
+Warnings:
+Note   1051    Unknown table '#sql-7c00_d'
[20 Nov 2007 3:39] Kevin Lewis
Chris, This is a wrong error message type bug, Priority 4.  See if there is anything you can do.  Thanks.
[13 Feb 2008 21:06] James Day
The workaround is to do these consecutively or use different tables for each connection. Only happens when it's the same table being altered in many connections.
[6 Oct 2008 16:13] Christopher Powers
Possibly related: Bug#39132, Bug#39670
[22 Jan 2009 20:06] Christopher Powers
falcon_bug_22165 passes routinely.

Also, the Pushbuild2 stress test falcon_online_alter passes routinely (recent exceptions are recovery-related, and have been resolved.)
[22 Feb 2009 23:22] Christopher Powers
The fix for Bug#42099 corrected several online alter issues, including this bug and the related bug, Bug#39670:

A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/63274

2957 Christopher Powers	2009-01-14
      Bug #42099 Falcon: Online ALTER add/drop primary key
      
      - Implemented online alter add/drop primary key
      - Improved index mapping between server and Falon