Bug #52926 mysqld reports two data nodes in a single node cluster
Submitted: 18 Apr 2010 18:20 Modified: 20 May 2010 9:54
Reporter: Oli Sennhauser Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: 7.0.13, MySQL Cluster, Ndb_number_of_data_nodes, single node cluster

[18 Apr 2010 18:20] Oli Sennhauser
Description:
When I start a single node cluster show global status reports for Ndb_number_of_data_nodes = 2. Which IMHO is wrong.

How to repeat:
Cluster Configuration
---------------------
[ndbd(NDB)]     1 node(s)
id=10   @127.0.0.1  (mysql-5.1.41 ndb-7.0.13, Nodegroup: 0, Master)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @127.0.0.1  (mysql-5.1.41 ndb-7.0.13)

[mysqld(API)]   5 node(s)
id=11 (not connected, accepting connect from any host)
id=12   @127.0.0.1  (mysql-5.1.41 ndb-7.0.13)
id=13 (not connected, accepting connect from any host)
id=14 (not connected, accepting connect from any host)
id=15 (not connected, accepting connect from any host)

show global status like 'ndb_nu%';
+--------------------------------+-------+
| Variable_name                  | Value |
+--------------------------------+-------+
| Ndb_number_of_data_nodes       | 2     |
| Ndb_number_of_ready_data_nodes | 1     |
+--------------------------------+-------+

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

[NDB_MGMD DEFAULT]
DataDir               = /home/mysql/cluster/7.0.13

[NDB_MGMD]
Id                    = 1
HostName              = localhost

[NDBD DEFAULT]

NoOfReplicas          = 1
DataDir               = /home/mysql/cluster/7.0.13
LockPagesInMainMemory = 0

[NDBD]
Id                    = 10
hostname              = localhost

#[NDBD]
#Id                    = 11
#hostname              = localhost

[MYSQLD DEFAULT]

[MYSQLD]
[MYSQLD]
[MYSQLD]
[MYSQLD]
[MYSQLD]

Suggested fix:
mysqld should find out how many nodes are there at all and not guess/use hard coded values.
[19 Apr 2010 11:50] Oli Sennhauser
i meant 2 (two) and not to
[20 Apr 2010 9:54] Hartmut Holzgraefe
I can't reproduce this, both the SQL level status variable and the internal NdbConnection::no_db_nodes() methods return one for the number of nodes to me 
in a one node setup, as expected.
[20 May 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".