Bug #31315 mysql_install_db fails if a default table type of NDB is set in my.cnf
Submitted: 1 Oct 2007 15:41 Modified: 1 Oct 2008 19:10
Reporter: Jim Dowling
Status: Closed
Category:Server: Installing Severity:S3 (Non-critical)
Version:5.1.22 OS:Any
Assigned to: Magnus Blaudd Target Version:
Tags: mysql_install_db default tabletype ndb
Triage: D1 (Critical)

[1 Oct 2007 15:41] Jim Dowling
Description:
If you use a my.cnf file as a parameter to mysql_install_db to initialize the default
tables, but have a parameter
"default-table-type=NDB"

How to repeat:
/mysql_install_db --defaults-file=/home/jdowling/.mysql/ndb-5.1.22-rc-
linux-i686-glibc23/mysql_1/my-5-1-22.cnf --force
Installing MySQL system tables...
071001 15:39:52 [ERROR] Unknown/unsupported table type: ndb
071001 15:39:52 [ERROR] Aborting

071001 15:39:52 [Note] /home/jdowling/.mysql/mysql-5.1.22-rc-linux-x86_64-glibc2
3/bin/mysqld: Shutdown complete

Installation of system tables failed!

Examine the logs in /home/jdowling/.mysql/ndb-5.1.22-rc-linux-i686-glibc23/mysql _1/var
for more information.
You can try to start the mysqld daemon with:
/home/jdowling/.mysql/mysql-5.1.22-rc-linux-x86_64-glibc23/bin/mysqld --skip-gra nt &
and use the command line tool
/home/jdowling/.mysql/mysql-5.1.22-rc-linux-x86_64-glibc23/bin/mysql to connect to the
mysql
database and look at the grant tables:

shell> /home/jdowling/.mysql/mysql-5.1.22-rc-linux-x86_64-glibc23/bin/mysql -u r oot
mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /home/jdowling/.mysql/ndb-5.1.22-rc-linux-i686-glibc23/mysql_ 1/var
that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the ./bin/mysqlbug script!

Failure: problem installing default mysql database.

my.cnf file:
#
# This my.cnf file was generated by ndbinstaller.
#

[mysqld]

basedir         = /home/jdowling/.mysql/mysql-5.1.22-rc-linux-x86_64-glibc23
datadir         = /home/jdowling/.mysql/ndb-5.1.22-rc-linux-i686-glibc23/mysql_1/var
port            = 3306
socket          = /tmp/mysql.sock

pid-file        =
/home/jdowling/.mysql/ndb-5.1.22-rc-linux-i686-glibc23/mysql_1/mysqld.pid

# use NDB storage engine and make NDB the default table type
ndbcluster
#default-table-type=ndb

# optimizations to improve performance of NDB
ndb-use-exact-count=0
ndb-force-send=1
engine-condition-pushdown=1

# do not include innodb engine (for easier installation)
skip-innodb

# replication settings go here
server-id=1848
log-bin=mysql-bin

[mysql_cluster]
ndb-connectstring=localhost:1186

NDB's config.ini:
[NDBD DEFAULT]
#The number of copies of the data stored on different nodes in the cluster
NoOfReplicas=2

#The amount of main memory (RAM) used to store columns and ordered indexes in tables,
plus some overhead
DataMemory=80M

#The amount of main memory (RAM) used to hash indexes in tables, plus some overhead
IndexMemory=16M

#The amount of disk space (NoOfFragmentLogFiles * 64MB) used to store the Redo Log (used
for node recovery)
NoOfFragmentLogFiles=7

#The speed at which LocalCheckpoints (LCP) are written to disk
DiskCheckpointSpeed=10M

#The speed at which LocalCheckpoints (LCP) are written to disk, as part of a node
recovery
DiskCheckpointSpeedInRestart=100M

#The size of the RedoLog Buffer in memory; Reduce for improved disk throughput (but
slower recovery time)
DiskSyncSize=4M

#The size of the RedoBuffer used to buffer writes to the disk subsystem. Increase for
high write-rate or slow disk.
RedoBuffer=8M

#The maximum time in ms that is permitted to lapse between operations in the same
transaction before the transaction is aborted.
TransactionInactiveTimeout=2000

#Time in ms between global checkpoint groups are flushed from memory to disk
TimeBetweenGlobalCheckpoints=1000

#Time in ms between local checkpoints of memory to local disk. Increase this if system is
highly loaded to improve node restart times.
TimeBetweenLocalCheckpoints=10

#Represents the number of seconds between memory usage reports written to the cluster
log
MemReportFrequency=300

#This prevents ndbd processes and DB memory from being swapped out to disk
LockPagesInMainMemory=1

[MYSQLD DEFAULT]

[NDB_MGMD DEFAULT]

[TCP DEFAULT]
# I found  this settting buggy with 5.1.17-beta, when starting ndb_mgmd process.
# SendBufferMemory=2M

# Management Server
[NDB_MGMD]
HostName=localhost
PortNumber=1186
DataDir= /home/jdowling/.mysql/ndb-5.1.22-rc-linux-i686-glibc23/mgmd1
LogDestination=FILE:filename=/home/jdowling/.mysql/logs/cluster.log,maxsize=1000000,maxfiles=6
NodeID=63

[NDBD]
HostName=localhost
DataDir=/home/jdowling/.mysql/logs
FileSystemPath=/home/jdowling/.mysql/ndb/ndb_data/1
NodeID=1

[NDBD]
HostName=localhost
DataDir=/home/jdowling/.mysql/logs
FileSystemPath=/home/jdowling/.mysql/ndb/ndb_data/2
NodeID=2

# Setup node IDs for mySQL API-servers (clients of the cluster)
[MYSQLD]

[MYSQLD]

[MYSQLD]
[1 Oct 2007 16:14] Miguel Solorzano
Thank you for the bug report.
[12 Oct 2007 18:07] Konstantin Osipov
Magnus, I believe this is in your hands. The fix is to run mysql_install_db with overriden
default of the default_storage_engine.

Otherwise the following code in the server triggers a failure:
 

  /*
    Check that the default storage engine is actually available.
  */
  if (default_storage_engine_str)
  {
    LEX_STRING name= { default_storage_engine_str,
                       strlen(default_storage_engine_str) };
    plugin_ref plugin;
    handlerton *hton;
    
    if ((plugin= ha_resolve_by_name(0, &name)))
      hton= plugin_data(plugin, handlerton*);
    else
    {
      sql_print_error("Unknown/unsupported table type: %s",
                      default_storage_engine_str);
      unireg_abort(1);
    }
[26 Oct 2007 15:39] 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/36434

ChangeSet@1.2600, 2007-10-26 15:39:04+02:00, msvensson@pilot.mysql.com +1 -0
  Bug#31315 mysql_install_db fails if a default table type of NDB is set in my.cnf
  - Use myisam as default storage engine when running mysqld in --bootstrap
  mode
[19 Nov 2007 9:19] Sveta Smirnova
Bug #32470 was marked as duplicate of this one.
[26 Nov 2007 18:47] Magnus Blaudd
Pushed to mysql-5.1-build
[28 Feb 2008 10:37] Magnus Blaudd
Pushed to 5.1.23 and 6.0.4
[3 Mar 2008 21:47] Paul DuBois
Noted in 5.1.23, 6.0.4 changelogs.

mysql_install_db failed if the default storage engine was NDB. Now it
explicitly uses MyISAM as the storage engine when running mysqld
--bootstrap.
[12 Mar 2008 22:40] Sveta Smirnova
Bug still exists in version 5.1.23
[13 Mar 2008 11:38] Magnus Blaudd
Apparently the bug never made it to 5.1.23-rc(just double checked) and it does not look
like the patch is in 5.1 repository either. It has probably been removed in a merge.
[2 Sep 2008 11:21] Magnus Blaudd
Recommited patch
[3 Sep 2008 9:00] 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/53106

2818 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 9:30] 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/53114

2732 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 9:35] 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/53115

2681 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 10:00] 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/53122

2672 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 10: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/53131

2744 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 10: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/53132

2818 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 10: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/53133

2732 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[3 Sep 2008 10: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/53134

2744 Magnus Svensson	2008-09-02 [merge]
      Merge bug#31315
[14 Sep 2008 4:59] Bugs System
Pushed into 6.0.7-alpha  (revid:msvensson@mysql.com-20080902085330-nwc5yva7ir20dpij)
(version source revid:sven@mysql.com-20080818175803-c1nutd5773r6b4gd) (pib:3)
[18 Sep 2008 7:53] Paul DuBois
Noted in 6.0.7 changelog.

mysql_install_db failed if run with the default table type set to
NDB.

Setting report to NDI pending push into 5.1.x.
[26 Sep 2008 14:30] 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/54543

2698 He Zhenxing	2008-09-26 [merge]
      Merge 5.1 main -> 5.1-rpl
[1 Oct 2008 18:03] Bugs System
Pushed into 5.1.28  (revid:msvensson@mysql.com-20080902091413-5aix9rsscpw1fcjg) (version
source revid:msvensson@mysql.com-20080902091413-5aix9rsscpw1fcjg) (pib:4)
[1 Oct 2008 19:10] Paul DuBois
Noted in 5.1.28 changelog.
[17 Oct 2008 18:43] Bugs System
Pushed into 6.0.8-alpha  (revid:msvensson@mysql.com-20080902091413-5aix9rsscpw1fcjg)
(version source revid:kpettersson@mysql.com-20080911114255-81pt7q1uvl1fkojq) (pib:5)
[28 Oct 2008 22:04] Bugs System
Pushed into 5.1.29-ndb-6.2.17  (revid:msvensson@mysql.com-20080902091413-5aix9rsscpw1fcjg)
(version source revid:tomas.ulin@sun.com-20081028140209-u4emkk1xphi5tkfb) (pib:5)
[28 Oct 2008 23:22] Bugs System
Pushed into 5.1.29-ndb-6.3.19  (revid:msvensson@mysql.com-20080902091413-5aix9rsscpw1fcjg)
(version source revid:tomas.ulin@sun.com-20081028194045-0353yg8cvd2c7dd1) (pib:5)
[1 Nov 2008 10:48] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:msvensson@mysql.com-20080902091413-5aix9rsscpw1fcjg)
(version source revid:jonas@mysql.com-20081101082305-qx5a1bj0z7i8ueys) (pib:5)
[13 Dec 2008 0:26] Bugs System
Pushed into 6.0.7-alpha  (revid:msvensson@mysql.com-20080902091600-q23j00agdmy0kss0)
(version source revid:tomas.ulin@sun.com-20080902154454-pvi3xa61d2wtxtbg) (pib:5)