Bug #56229 --skip-config-cache and --config-cache=0 do not function when there is a cache
Submitted: 24 Aug 2010 19:26 Modified: 9 Sep 2010 6:43
Reporter: Daniel Smythe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:mysql-5.1.47 ndb-7.1.5 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: cluster, configuration cache
Triage: Triaged: D3 (Medium) / R6 (Needs Assessment) / E6 (Needs Assessment)

[24 Aug 2010 19:26] Daniel Smythe
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.
[25 Aug 2010 7:30] Magnus BlÄudd
Workaroudn would be to remove the binary config file ndb_<node_id>_config.<generation>.bin, either manually or with the --initial switch.
[8 Sep 2010 15:49] John David Duncan
The --skip-config-cache option is used to prevent a management server from creating a cached configuration, and from sharing its configuration with other management servers.  When a cached configuration that already exists is no longer desired, the --initial option can be used to start a management server that will ignore (and delete) that configuration.  So perhaps we can document this more clearly, but I think what you are seeing here is not a bug, and that the --initial option is what you're looking for.
[9 Sep 2010 5:56] Jon Stephens
Updated tags/lead, set target.
[9 Sep 2010 6:43] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.