Bug #18595 repeated create, insert, drop can cause MySQL table definition cache to corrupt
Submitted: 29 Mar 2006 1:32 Modified: 15 Jun 2006 11:46
Reporter: Jonathan Miller
Status: Closed
Category:Server: Cluster Severity:S2 (Serious)
Version:4.1,5.0,5.1 OS:Linux (Linux 32 Bit OS)
Assigned to: Tomas Ulin Target Version:

[29 Mar 2006 1:32] Jonathan Miller
Description:
Running the cid_ndb_dd2.pl script causes issues where some mysqld can retrieve tables
information and others can not. I am taking a guess that this has to do with table
definition cache.

After running the test for a while the test bombs on a delete of table t1 stating it can
not find it. Looking in MySQLD on the same system I get the following.

mysql> use TESTER2
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn't find any fields in table 't1'
Database changed
mysql> SHOW CREATE TABLE t1;
ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER

mysql> select * from t1;
ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER

I had 2 MySQLD process running on this system and both gave me the same results. Yet on
the other 3 MySQLD processes I have running return correct results:

mysql> use TESTER2 Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from t1; Empty set (0.02 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `c1` int(11) NOT NULL DEFAULT '0',
  `c2` char(4) DEFAULT NULL,
  `c3` float DEFAULT NULL,
  `c4` double DEFAULT NULL,
  `c5` bit(4) DEFAULT NULL,
  `c6` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`c1`)
) TABLESPACE TESTER2_TS STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION
BY KEY ()
1 row in set (0.01 sec)

DBD::mysql::st execute failed: Unknown table 't1' at ./cid_ndb_dd2.pl line 166.
Drop table error: Unknown table 't1' at ./cid_ndb_dd2.pl line 166.

How to repeat:
run attached test script. It may take a while to happen
[29 Mar 2006 1:32] Jonathan Miller
CID_NDB_DD2

Attachment: cid_ndb_dd2.pl (application/x-perl, text), 6.98 KiB.

[29 Mar 2006 1:33] Jonathan Miller
I have repeated this 3 times now
[2 Apr 2006 7:51] Jonas Oreland
Kostja: This must be cluster specific.
[21 Apr 2006 15:22] Tomas Ulin
I'm _not_ saying it is _not a bug_.

I'm _asking_:

Does the error repair itself after retrying a select, or is it permanent?

If it is permanent we will work on it immediately.

If it is not, it is a known deficiency (by the dev team), then we will not start working
on it immediatly.  As we have other issues that are more severe.

Thanks,

T
[10 May 2006 0:23] Jonathan Miller
Ran a mini stress today and got errors 704 during the testing. I now get the same issue.
[10 May 2006 0:24] Jonathan Miller
********* Start New Loop ***********
Connected to MySQLD
Database Created.
Creating jonas.t1, please stand by....
Table jonas.t1 Created!!!!!
Inserting data
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
573 rows of data inserted.....
Data Deleted.
DBD::mysql::st execute failed: Unknown table 't1' at cid_ndb_dd.pl line 507.
DBD::mysql::st execute failed: Unknown table 't1' at cid_ndb_dd.pl line 507.

mysql> use jonas
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------+
| Tables_in_jonas |
+-----------------+
| t1              |
+-----------------+
1 row in set (0.00 sec)

mysql> select * from t1;
ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER
mysql> show create table t1;
ERROR 1296 (HY000): Got error 4243 'Index not found' from NDBCLUSTER
mysql>
[10 May 2006 11:43] Tomas Ulin
can you please provide the testcase to reproduce this... pererably if you have a
mysql-test-run test that get's it

BR,

Tomas
[10 May 2006 11:45] Tomas Ulin
can you please provide the testcase to reproduce this... pererably if you have a
mysql-test-run test that get's it

BR,

Tomas
[10 May 2006 15:19] Jonathan Miller
Begin Loop

Connect to server
Create database
If using DD{
   Create LFG
   Create TS
}
Create table
Random amount rows are inserted
Delete from the table
Sleep for a few
Drop table 
Drop Database
If using DD{
   Drop TS
   Drop LFG
}
Disconnect from database

End Loop

So where I got the latest the disk data was not in use.

1) cid_dd_ndb.pl -so
2) cid_dd_ndb.pl -so -d jonas
3) cid_dd_ndb.pl -so -d tomas

All on different MySQLD attached to the same cluster
[14 Jun 2006 10:15] Tomas Ulin
this can happen in any version

workaround, do drop table again
[14 Jun 2006 10:32] Bugs System
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/7605
[14 Jun 2006 11:03] Bugs System
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/7608
[14 Jun 2006 12:06] Tomas Ulin
pushed to
5.1.12, 5.0.23, 4.1.21
[15 Jun 2006 11:46] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented in 4.1.21/5.0.23/5.1.12 changelogs. Changed category to CDD since this
appeared to be a DD test. Closed.