Bug #61624 ndb-7.1.9 - not allocating extra node id as per config
Submitted: 24 Jun 2011 10:36 Modified: 1 Jul 2011 14:15
Reporter: Hariharan Madhavan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:mysql-5.1.51 ndb-7.1.9 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[24 Jun 2011 10:36] Hariharan Madhavan
Description:
Here is my config file ( Note the extra mysql api I have given)

[TCP DEFAULT]
SendBufferMemory=2M
ReceiveBufferMemory=2M

[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=128M
IndexMemory=128M
ODirect=1
TimeBetweenGlobalCheckpoints=1000
TimeBetweenEpochs=200

[MYSQLD DEFAULT]

[NDB_MGMD DEFAULT]

# Section for the cluster management node
[NDB_MGMD]
DataDir=/var/lib/mysql-cluster
HostName=192.168.221.102
NodeId=49
# Section for the storage nodes
[NDBD]
# IP address of the first storage node
NodeId=1
HostName=192.168.221.100
DataDir= /var/lib/mysql-cluster
[NDBD]
# IP address of the second storage node
NodeId=2
HostName=192.168.221.101
DataDir=/var/lib/mysql-cluster

# one [MYSQLD] per storage node
[MYSQLD]
NodeId=3
HostName=192.168.221.100
[MYSQLD]
NodeId=4
HostName=192.168.221.101
# This one for ndb utilities to connect
[MYSQLD]

Here is the ndb_mgm show:

[root@mgmt mysql-cluster]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=1    @192.168.221.100  (mysql-5.1.51 ndb-7.1.9, Nodegroup: 0)
id=2    @192.168.221.101  (mysql-5.1.51 ndb-7.1.9, Nodegroup: 0, Master)

[ndb_mgmd(MGM)] 1 node(s)
id=49   @192.168.221.102  (mysql-5.1.51 ndb-7.1.9)

[mysqld(API)]   2 node(s)
id=3    @192.168.221.100  (mysql-5.1.51 ndb-7.1.9)
id=4    @192.168.221.101  (mysql-5.1.51 ndb-7.1.9)

ndb_mgm>

Frankly speaking another node id should have been allocated for the extra mysql api, 
but I guess its a bug that it was not allocated.

Because of this, my ndb_desc utility can be run, only if I stop any one of the mysql nodes. I cannot restore backup
unless I stop one of the data nodes. But since I need both nodes to restore backup, I think backup restoration is
totally sabotaged. I can only take backup with "start backup" command, neva restore it.

How to repeat:
I used the following RPM's:

data+storage node:

[root@data1 ~]# rpm -qa | grep MySQL
MySQL-Cluster-gpl-extra-7.1.9a-1.rhel5
MySQL-Cluster-gpl-tools-7.1.9a-1.rhel5
MySQL-Cluster-gpl-storage-7.1.9a-1.rhel5
MySQL-Cluster-gpl-server-7.1.9a-1.rhel5
MySQL-Cluster-gpl-client-7.1.9a-1.rhel5

Mgmt Node:

[root@mgmt mysql-cluster]# rpm -qa | grep MySQL
MySQL-Cluster-gpl-client-7.1.9a-1.rhel5
MySQL-Cluster-gpl-extra-7.1.9a-1.rhel5
MySQL-Cluster-gpl-tools-7.1.9a-1.rhel5
MySQL-Cluster-gpl-management-7.1.9a-1.rhel5

The Config is provided above.

Suggested fix:

The ndb_mgmd utility must allocate additional mysql api node id's
[30 Jun 2011 15:49] MySQL Verification Team
If you have added the extra [MYSQLD] block after the initial startup of the cluster you must restart the ndb_mgmd node (not the ndbd) with --initial or --reload to apply the config change *and* restart each of the NDBD nodes in sequence.  It is common to miss this --reload/initial option.
[1 Jul 2011 13:39] Hariharan Madhavan
Thank you for your feedback Matthew.

I doubted that as the first thing, and did a rolling restart.

the ndb nodes were started only with --initial

Best Regards,
Hari.
[1 Jul 2011 13:52] Hariharan Madhavan
The ndb_mgmd node was restarted with ndb_mgmd -f /var/log/mysql-cluster/config.ini