Bug #29186 write >4gb into 1 datafile on a 32-bit computer, offset wraps causing corruption
Submitted: 18 Jun 2007 22:36 Modified: 20 Feb 2008 21:57
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S1 (Critical)
Version:mysql-5.1 OS:Linux
Assigned to: li zhou CPU Architecture:Any

[18 Jun 2007 22:36] Jonathan Miller
Description:
Hi,

In trying to reproduce a customer issue I have hit this twice in a row now. 

Basically I use their configuration file with just a few modification to it, I create LOGFILE group, Tablespace and use the customers schema with just a few modification for hugoload to create disk data tables. THen I use hugoload to populate the tables to contain 600000 rows each.

Once that is done I issue the "START BACKUP" and after a few mintues both data nodes crash and I am unable to recover the cluster as the file system is now corrupted.

Time: Monday 18 June 2007 - 22:17:52
Status: Temporary error, restart node
Message: Internal program error (failed ndbassert) (Internal error, programming error or missing error message, please report a bug)
Error: 2343
Error data: dbtup/DbtupPageMap.cpp
Error object: DBTUP (Line: 116) 0x0000000a
Program: /home/ndbdev/jmiller/builds/libexec/ndbd
Pid: 18792
Trace: /space/run/ndb_2_trace.log.1
Version: mysql-5.1.15 ndb-6.1.12-beta
***EOM***

Current byte-offset of file-pointer is: 568

Time: Monday 18 June 2007 - 22:17:15
Status: Temporary error, restart node
Message: Internal program error (failed ndbassert) (Internal error, programming error or missing error message, please report a bug)
Error: 2343
Error data: dbtup/DbtupPageMap.cpp
Error object: DBTUP (Line: 116) 0x0000000a
Program: /home/ndbdev/jmiller/builds/libexec/ndbd
Pid: 4313
Trace: /space/run/ndb_3_trace.log.1
Version: mysql-5.1.15 ndb-6.1.12-beta

NOTE: This was done using a debug build.
 

How to repeat:
1) Start cluster with customers configuration options
2) Create log file group
mysql> CREATE LOGFILE GROUP lg1 ADD UNDOFILE './lg1/undofile.dat' INITIAL_SIZE 2500M UNDO_BUFFER_SIZE = 8M ENGINE=NDB;
mysql> ALTER LOGFILE GROUP lg1 ADD UNDOFILE './lg1/undofile1.dat' INITIAL_SIZE 2500M ENGINE=NDB;
3) Create Tables Spave
CREATE TABLESPACE ts_subsdata ADD DATAFILE './ts_subsdata/datafile.dat' USE LOGFILE GROUP lg1 INITIAL_SIZE 8000M ENGINE=NDB;
ALTER TABLESPACE ts_subsdata ADD DATAFILE './ts_subsdata/datafile2.dat' INITIAL_SIZE 8000M ENGINE=NDB;
4) Load customer scehma
source /space/run/DB_HLR_M13SUB_D.sql
5) use hugoload to load tables each with 600000 rows
6) Start the backup
[21 Jun 2007 3:52] Jonathan Miller
retested...instead of creating 2 8Gb files, we created 5 3Gb files and all test passed fine.

Suggested Fix:

easy fix is to only allow 4gb files on 32-bit computers...
[27 Sep 2007 12:02] Tomas Ulin
Leonard,

please add limit, such that the 4Gb limit cannot be exceeded

<jonas|busy-fixing-bug> tomas: solution = limit, it should be "trivial" to add to both tsman/lgman

BR,

T
[12 Oct 2007 5:48] 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/35439

ChangeSet@1.2552, 2007-10-12 13:32:08+00:00, lzhou@dev3-63.(none) +4 -0
  BUG#29186 Return error to client in the following condition:
            1: Create a log file which is larger than 4G in 32-bit host.
            2: Create a data file (tablespace) which is larger than 4G in 32-bit host.
[12 Oct 2007 10:12] 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/35459

ChangeSet@1.2552, 2007-10-12 17:56:04+00:00, lzhou@dev3-63.(none) +4 -0
  BUG#29186 Return error to client in the following condition:
            1: Create a log file which is larger than 4G in 32-bit host.
            2: Create a data file (tablespace) which is larger than 4G in 32-bit host.
[16 Oct 2007 7:11] 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/35614

ChangeSet@1.2552, 2007-10-16 14:54:34+00:00, lzhou@dev3-63.(none) +7 -0
  BUG#29186 Return error to client in the following condition:
            1: Create a log file which is larger than 4G in 32-bit host.
            2: Create a data file (tablespace) which is larger than 4G in 32-bit host.
[12 Nov 2007 7:12] 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/37557

ChangeSet@1.2552, 2007-11-12 14:53:25+00:00, lzhou@dev3-63.(none) +7 -0
  BUG#29186 Return error to client in the following condition:
            1: Create a log file which is larger than 4G in 32-bit host.
            2: Create a data file (tablespace) which is larger than 4G in 32-bit host.
[13 Nov 2007 9:09] li zhou
pushed into 5.1.22 ndb-bj tree
[1 Feb 2008 22:10] Jon Stephens
Documented in 5.1.23-ndb-6.3.8 changelog as follows:

        It is no longer possible on 32-bit systems to issue statements
        appearing to create Disk Data log files or data files greater
        than 4 GB in size. (Trying to create log files or data files
        larger than 4 GB eventually on 32-bit systems led to
        unrecoverable data node failures; such statements now fail with
        NDB error 1515.)

Also updated NDB error code listing in Cluster API docs.

Left bug in PQ status pending further merges.
[2 Feb 2008 11:08] Jon Stephens
Also updated {CREATE|ALTER} {TABLESPACE|LOGFILE GROUP} Syntax sections of 5.1 Manual with limitation.
[2 Feb 2008 11:09] Jon Stephens
Also documented fix for 5.1.23-ndb-6.2.11; left status unchanged.
[20 Feb 2008 16:02] Bugs System
Pushed into 5.1.24-rc
[20 Feb 2008 16:04] Bugs System
Pushed into 6.0.5-alpha
[20 Feb 2008 21:57] Jon Stephens
Also documented for 5.1.24 and 6.0.5.