Description:
If a restore is attempted but there are no free [mysqld] then the restore bails with:
$ ndb_restore -r -m -n 2 -b 1 /data0/dump/BACKUP-1-SMAL/
Ndb version in backup files: Version 5.0.12
Configuration error: Could not alloc node id at localhost port 1186: No free node id found for mysqld(API).
Segmentation fault: 11 (core dumped)
tracing using gdb reveals:
$ gdb ndb_restore ndb_restore.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `ndb_restore'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.3...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /usr/lib/libpthread.so.2...done.
Loaded symbols for /usr/lib/libpthread.so.2
Reading symbols from /usr/lib/libstdc++.so.5...done.
Loaded symbols for /usr/lib/libstdc++.so.5
Reading symbols from /lib/libm.so.4...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x08053843 in Ndb::setCatalogName (this=0x0,
a_catalog_name=0x80f5e20 "benchw") at Ndb.cpp:1061
1061 theImpl->m_dbname.assign(a_catalog_name);
[New LWP 100226]
(gdb) bt
#0 0x08053843 in Ndb::setCatalogName (this=0x0,
a_catalog_name=0x80f5e20 "benchw") at Ndb.cpp:1061
#1 0x080538a2 in Ndb::setDatabaseName (this=0x0,
a_catalog_name=0x80f5e20 "benchw") at Ndb.cpp:1091
#2 0x0804ddef in BackupRestore::table (this=0x80f4a80, table=@0x8113280)
at BaseString.hpp:193
#3 0x0804c5ef in main (argc=0, argv=0x80fc234) at Restore.hpp:292
(gdb)
How to repeat:
Config
----------
$ cat /data0/mymgmt/5.0/config.ini
[ndbd default]
noofreplicas=1
datamemory=256M
indexmemory=64M
maxnoofconcurrentoperations=120000
maxnooflocaloperations=120000
maxnooforderedindexes=512
[ndb_mgmd default]
datadir=/data0/mymgmt/5.0
[ndb_mgmd]
id=1
hostname=localhost
[ndbd]
id=2
hostname=localhost
datadir=/data0/myndb/5.0
# Note only 1 mysqld is defined.
# If you have more, then to elicit the bug you must start *all* of them
# before trying to restore!
#
[mysqld]
id=4
hostname=localhost
[tcp default]
portnumber=2202
Wipe out the cluster:
--------------------------------
$ ndb_mgm -e shutdown
$ mysqladmin -u root shutdown
$ cd /data0/myndb/5.0; rm -rf *
Then startup and attempt restore (I am assuming you have a vaild backup!):
---------------------------------
$ /usr/local/mysql/5.0/libexec/ndb_mgmd -f /data0/mymgmt/5.0/config.ini
$ /usr/local/mysql/5.0/libexec/ndbd
$ mysqld_safe --defaults-file=/data0/myclust/5.0/my.cnf --datadir=/data0/myclust/5..0 &
$ ndb_restore -r -m -n 2 -b 1 /data0/dump/BACKUP-1-SMAL/
Ndb version in backup files: Version 5.0.12
Configuration error: Could not alloc node id at localhost port 1186: No free node id found for mysqld(API).
Segmentation fault: 11 (core dumped)
Suggested fix:
Have not looked at the code yet (will later today).