Description:
Attempting to use --skip-config-cache or --config-cache=0 on a ndb_mgmd node which already has a cached config does not ignore the cached config and reload the config file as expected.
How to repeat:
[root@localhost local]# /usr/local/mysql/bin/ndb_mgmd --config-file=/etc/ndb.ini
2010-08-24 12:05:24 [MgmtSrvr] INFO -- NDB Cluster Management Server. mysql-5.1.47 ndb-7.1.5
2010-08-24 12:05:24 [MgmtSrvr] INFO -- Loaded config from '/usr/local/mysql/mysql-cluster/ndb_1_config.bin.1'
[root@localhost local]# /usr/local/mysql/bin/ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 4 node(s)
id=2 (not connected, accepting connect from 192.168.1.151)
id=3 (not connected, accepting connect from 192.168.1.152)
id=8 (not connected, accepting connect from 192.168.1.153)
id=9 (not connected, accepting connect from 192.168.1.154)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.151 (mysql-5.1.47 ndb-7.1.5)
[mysqld(API)] 4 node(s)
id=4 (not connected, accepting connect from any host)
id=5 (not connected, accepting connect from any host)
id=6 (not connected, accepting connect from any host)
id=7 (not connected, accepting connect from any host)
ndb_mgm> quit
Then change the config file to include, say, another node:
[root@localhost local]# cat /etc/ndb.ini
# Example Ndbcluster storage engine config file.
#
[ndbd default]
NoOfReplicas= 2
MaxNoOfConcurrentOperations= 10000
DataMemory= 80M
IndexMemory= 24M
TimeBetweenWatchDogCheck= 30000
DataDir= /var/lib/mysql-cluster
MaxNoOfOrderedIndexes= 512
[ndb_mgmd default]
DataDir= /var/lib/mysql-cluster
[ndb_mgmd]
Id=1
HostName= 192.168.1.151
[ndbd]
Id= 2
HostName= 192.168.1.151
[ndbd]
Id= 3
HostName= 192.168.1.152
[ndbd]
Id= 8
HostName= 192.168.1.153
[ndbd]
Id= 9
HostName= 192.168.1.154
[ndbd] <--- new
Id= 10 <--- new
HostName= 192.168.1.199 <---- new
Shutdown ndb_mgmd, and restart with --skip-config-cache or --config-cache=0
[root@localhost local]# /usr/local/mysql/bin/ndb_mgmd --config-cache=0 --config-file=/etc/ndb.ini
2010-08-24 12:10:11 [MgmtSrvr] INFO -- NDB Cluster Management Server. mysql-5.1.47 ndb-7.1.5
2010-08-24 12:10:11 [MgmtSrvr] INFO -- Loaded config from '/usr/local/mysql/mysql-cluster/ndb_1_config.bin.1'
[root@localhost local]# /usr/local/mysql/bin/ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 4 node(s)
id=2 (not connected, accepting connect from 192.168.1.151)
id=3 (not connected, accepting connect from 192.168.1.152)
id=8 (not connected, accepting connect from 192.168.1.153)
id=9 (not connected, accepting connect from 192.168.1.154)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @192.168.1.151 (mysql-5.1.47 ndb-7.1.5)
[mysqld(API)] 4 node(s)
id=4 (not connected, accepting connect from any host)
id=5 (not connected, accepting connect from any host)
id=6 (not connected, accepting connect from any host)
id=7 (not connected, accepting connect from any host)
ndb_mgm> quit
Observe the new node not listed.
Suggested fix:
--skip-config-cache or --config-cache=0 should ignore an already cached config, otherwise, documentation should be updated to explicitly state that these will not override an already cached config.