Bug #31769 Create a log/data file with long name will crash ndbd
Submitted: 23 Oct 2007 1:38 Modified: 19 Feb 2009 15:14
Reporter: li zhou Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:5.1.22 OS:Any
Assigned to: Jonas Oreland
Triage: Triaged: D1 (Critical)

[23 Oct 2007 1:38] li zhou
Description:
When create a log/data file with extra long name will crash the ndbd.
Seems when name+path longer than 128 will crash ndbd.

How to repeat:
mysql> CREATE LOGFILE GROUP lg1 ADD UNDOFILE
'./tmplogfile/path1/path2/path3/path4/path5/path6/path7/path8/path9/path10/path11/path12/path13/path14/ThisisalongfilenameoflogfileThisisalongfilenameoflogfileThisisalongfilenameoflogfileThisisalongfilenameoflogfile.dat'
       INITIAL_SIZE 16M
       UNDO_BUFFER_SIZE = 1M
       ENGINE NDB;

ndbd crashed.

Suggested fix:
ndbd shouldn't crash in this condition.
[24 Oct 2007 14:01] Bogdan Kecman
Could not duplicate this problem.

Can you provide us with information on what Linux distribution you are running your cluster setup on, what kernel you use and what filesystem the node data is running on.
[25 Oct 2007 2:28] li zhou
The information of my machine is:

[zhl@dev3-63 ndbcluster-9310]$ uname -a
Linux dev3-63 2.6.9-8.11smp #1 SMP Thu Aug 3 14:04:51 CST 2006 i686 i686 i386 GNU/Linux

The operation is very simple:
>cd mysql-test
>./mysql-test-run.pl --start-and-exit --do-test=ndb
>cd ..
>start the mysql client
mysql> CREATE LOGFILE GROUP lg1 ADD UNDOFILE
'./tmplogfile/path1/path2/path3/path4/path5/path6/path7/path8/path9/path10/path11/path12/path13/path14/ThisisalongfilenameoflogfileThisisalongfilenameoflogfileThisisalongfilenameoflogfileThisisalongfilenameoflogfile.dat'
       INITIAL_SIZE 16M
       UNDO_BUFFER_SIZE = 1M
       ENGINE NDB;
ERROR 1525 (HY000): Failed to create UNDOFILE
mysql>exit.

Then you can see the two ndbd has crashed.
I will attach the log file. Wish help to reproduct.
[25 Oct 2007 2:30] li zhou
Log file of ndbd and ndb_mgmd.

Attachment: log.tar.gz (application/x-gzip-compressed, text), 147.81 KiB.

[19 Feb 2009 12:13] 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/66892

2847 Jonas Oreland	2009-02-19
      ndb - bug#31769 - fix path name longer than MAX_TAB_NAME, i.e use PATH_MAX is several places
[19 Feb 2009 12: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/66895

2847 Jonas Oreland	2009-02-19
      ndb - bug#31769 bug#31772 bug#31770 - fix path name longer than MAX_TAB_NAME, i.e use PATH_MAX is several places
[19 Feb 2009 13:04] Bugs System
Pushed into 5.1.32-ndb-6.2.17 (revid:jonas@mysql.com-20090219122238-h87lxgiiur7xwdl8) (version source revid:jonas@mysql.com-20090219122238-h87lxgiiur7xwdl8) (merge vers: 5.1.32-ndb-6.2.17) (pib:6)
[19 Feb 2009 13:05] Bugs System
Pushed into 5.1.32-ndb-6.3.23 (revid:jonas@mysql.com-20090219123956-j8x3hj0ae2xwyduz) (version source revid:jonas@mysql.com-20090219123956-j8x3hj0ae2xwyduz) (merge vers: 5.1.32-ndb-6.3.23) (pib:6)
[19 Feb 2009 13:06] Bugs System
Pushed into 5.1.32-ndb-6.4.3 (revid:jonas@mysql.com-20090219125659-ld2mlhzpqj9tfg9u) (version source revid:jonas@mysql.com-20090219125659-ld2mlhzpqj9tfg9u) (merge vers: 5.1.32-ndb-6.4.3) (pib:6)
[19 Feb 2009 15:14] Jon Stephens
Documented bugfix in the NDB-6.2.17, 6.3.23, and 6.4.2 changelogs as follows:

        Using a path or filename longer than 128 characters for Disk
        Data undo log files and tablespace data files caused a number of
        issues, including failures of CREATE LOGFILE GROUP, ALTER
        LOGFILE GROUP, CREATE TABLESPACE, and ALTER TABLESPACE
        statements, as well as crashes of management nodes and data
        nodes.

        With this fix, the maximum length for path and file names used
        for Disk Data undo log files and tablespace data files is now
        the same as the maximum for the operating system.