Bug #37116 Silent failure creating cluster datafile >4gb on 32-bit systems
Submitted: 31 May 2008 4:04 Modified: 14 Dec 2008 10:53
Reporter: Simon Litchfield Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:5.1.23-ndb-6.2.15-log OS:Linux (on x86 32bit)
Assigned to: li zhou CPU Architecture:Any

[31 May 2008 4:04] Simon Litchfield
Description:
Creating a datafile >4gb on a 32-bit system returns immediately with status OK, but fails to create the datafile.

How to repeat:
Works --
CREATE TABLESPACE data_space
ADD DATAFILE 'cluster_data_1.dat'
USE LOGFILE GROUP log_group
INITIAL_SIZE 4294967295
ENGINE NDB;

Silently doesn't work --
CREATE TABLESPACE data_space
ADD DATAFILE 'cluster_data_1.dat'
USE LOGFILE GROUP log_group
INITIAL_SIZE 4294967296
ENGINE NDB;

Suggested fix:
Raise an error if for whatever reason, the datafile isn't created successfully.
[31 May 2008 18:39] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please indicate how you check if datafile is created.
[2 Jun 2008 13:17] Hartmut Holzgraefe
Verified, first statement above creates a 4.1G file in the nodes $DataDir/ndb_#_fs directory and takes quite a while to initialize it.

The second statement only creates a 1.1M file and returns almost
immediately.

Looks like a rather obvious integer overflow issue, i'll still
try to reproduce it on 64bit.
[2 Jun 2008 13:42] Hartmut Holzgraefe
32bit specific indeed, so probably a C long variable without length check?
[24 Jun 2008 2:37] 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/48367

2630 Leonard Zhou	2008-06-24
      BUG#37116 Object file can create correctly when file_size is larger than 4G in 64 bits platform.
[10 Dec 2008 6:22] Bugs System
Pushed into 5.1.30-ndb-6.4.0  (revid:leonard@mysql.com-20080624100433-92eh6r36j0tmdspc) (version source revid:zhou.li@sun.com-20081210060918-7q80dfhuwnh0wm8j) (pib:5)
[10 Dec 2008 6:33] Bugs System
Pushed into 5.1.30-ndb-6.3.20  (revid:leonard@mysql.com-20080624100433-92eh6r36j0tmdspc) (version source revid:zhou.li@sun.com-20081210055758-2xnlpmbbzxdvx7x9) (pib:5)
[10 Dec 2008 7:24] Bugs System
Pushed into 5.1.24-ndb-6.2.16  (revid:leonard@mysql.com-20080624100433-92eh6r36j0tmdspc) (version source revid:leonard@mysql.com-20080624100433-92eh6r36j0tmdspc) (pib:5)
[12 Dec 2008 23:25] Bugs System
Pushed into 6.0.9-alpha  (revid:leonard@mysql.com-20080624100433-92eh6r36j0tmdspc) (version source revid:tomas.ulin@sun.com-20081210101134-6v8i9jhzw59vnmit) (pib:5)
[14 Dec 2008 10:53] Jon Stephens
Documented in the ndb-6.2.17 and ndb-6.3.20 changelogs as follows:

        Creation of a tablespace data file whose size was greater than 4 GB
        failed silently on 32-bit platforms.

[ndb-6.2.17 entry:]

        This improves on a previous fix for this issue that was made in MySQL
        Cluster 6.2.11.

[ndb-6.3.20 entry:]

        This improves on a previous fix for this issue that was made in MySQL
        Cluster 6.3.8.

        See also Bug#29186.