Bug #28770 file already opened error when corrupt schema file
Submitted: 30 May 2007 10:02 Modified: 11 Jun 2007 20:15
Reporter: Tomas Ulin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: Tomas Ulin CPU Architecture:Any

[30 May 2007 10:02] Tomas Ulin
Description:
cluster keeps 2 copies of schema files:

e.g.

D1/DBDICT/T0/S1.TableList
D2/DBDICT/T0/S1.TableList

if first is corrupt, it should read second

however, ndbd shuts down with error:

Time: Wednesday 30 May 2007 - 11:08:38
Status: Temporary error, restart node
Message: File has already been opened (Internal error, programming error or missing error message, please report a bug)
Error: 2807
Error data: open: >/home/tomas/telco-6.1/mysql-test/ndbcluster-1186/ndb_1_fs/D1/DBDICT/T0/S0.TableList< existing: >/home/tomas/telco-6.1/
mysql-test/ndbcluster-1186/ndb_1_fs/D1/DBDICT/T0/S0.TableList<
Error object: OpenFiles::insert()
Program: /home/tomas/telco-6.1/storage/ndb/src/kernel/nd
Time: Wednesday 30 May 2007 - 11:21:03
Status: Temporary error, restart node
Message: File has already been opened (Internal error, programming error or missing error message, please report a bug)
Error: 2807
Error data: open: >/home/tomas/telco-6.1/mysql-test/ndbcluster-1186/ndb_1_fs/D1/DBDICT/T0/S0.TableList< existing: >/home/tomas/telco-6.1/
mysql-test/ndbcluster-1186/ndb_1_fs/D1/DBDICT/T0/S0.TableList<
Error object: OpenFiles::insert()
Program: /home/tomas/telco-6.1/storage/ndb/src/kernel/nd

How to repeat:
in mysql-test

ndb/ndbcluster --initial
killall -9 ndbd ndb_mgmd
cat > ndbcluster-1186/ndb_1_fs/D1/DBDICT/T0/S1.TableList 
<ctrl-D>
ndb/ndbcluster

->error
[30 May 2007 10:09] 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/27661

ChangeSet@1.2407, 2007-05-30 12:29:19+02:00, tomas@whalegate.ndb.mysql.com +1 -0
  Bug #28770 file already opened error when corrupt schema file
  - make sure we close the first file, before opening the next
[31 May 2007 11:23] 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/27798

ChangeSet@1.2513, 2007-05-31 13:23:16+02:00, jmiller@mysql.com +2 -0
  Dbdict.cpp:
    Added ERROR_INSERT to Dbdict to fake the block out that a read on table file 1 has failed. This is to ensure that Dbdict does the right thing in closing file 1 before it tries to open file 2. This is associated with Bug#28770
  ERROR_codes.txt:
    Added new error (6100) for ERROR_INSERT to Dbdict to fake the block out that a read on table file 1 has failed. This is associated with Bug#28770
[2 Jun 2007 14:26] 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/27984

ChangeSet@1.2515, 2007-06-02 16:26:37+02:00, jmiller@mysql.com +3 -0
  Updated patch for testing the fix to Bug#28770
[5 Jun 2007 12:22] 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/28117

ChangeSet@1.2515, 2007-06-05 14:22:19+02:00, jmiller@mysql.com +3 -0
  testSystemRestart.cpp, Dbdict.cpp, ERROR_codes.txt:
    Updated patch with corrections requested by Tomas for Bug#28770:
[5 Jun 2007 12:50] 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/28119

ChangeSet@1.2519, 2007-06-05 14:50:12+02:00, jmiller@mysql.com +1 -0
  testSystemRestart.cpp:
    Over looked 6100 in comment for test case, updated to match 6007 Bug#28770:
[5 Jun 2007 15:02] 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/28126

ChangeSet@1.2520, 2007-06-05 17:02:08+02:00, jmiller@mysql.com +1 -0
  daily-basic-tests.txt:
    Added new error insertion test for Bug#28770 in to daily-basic-tests per Jonas
[11 Jun 2007 11:39] Bugs System
Pushed into 5.1.20-beta
[11 Jun 2007 11:42] Bugs System
Pushed into 5.0.44
[11 Jun 2007 20:15] 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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented in 5.0.44, 5.1.20, and telco-6.1.10 changelogs.
[3 Jul 2007 6:43] Jon Stephens
Also documented for telco-6.2.3 release.