Bug #27999 Single User Mode: Management client should show API permitted to connect
Submitted: 21 Apr 2007 11:35 Modified: 2 Mar 2010 16:09
Reporter: Jon Stephens Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:mysql-5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: 5.0, 5.1

[21 Apr 2007 11:35] Jon Stephens
Description:
When the cluster is in single user mode, it would be helpful to know which API is the one permitted to connect from the output of SHOW or STATUS.

How to repeat:
jon@rodan:/usr/local/mysql/bin> ./ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     4 node(s)
id=5    @192.168.0.103  (Version: 5.1.18, Nodegroup: 0, Master)
id=6    @192.168.0.102  (Version: 5.1.18, Nodegroup: 0)
id=7    @192.168.0.103  (Version: 5.1.18, Nodegroup: 0)
id=8    @192.168.0.102  (Version: 5.1.18, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=1    @192.168.0.103  (Version: 5.1.18)
id=2    @192.168.0.102  (Version: 5.1.18)

[mysqld(API)]   6 node(s)
id=10   @192.168.0.103  (Version: 5.1.18)
id=11   @192.168.0.102  (Version: 5.1.18)
id=12 (not connected, accepting connect from any host)
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)

jon@rodan:/usr/local/mysql/bin> ./ndb_mgm -e "ENTER SINGLE USER MODE 10"
Connected to Management Server at: localhost:1186
Single user mode entered
Access is granted for API node 10 only.
jon@rodan:/usr/local/mysql/bin> ./ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     4 node(s)
id=5    @192.168.0.103  (Version: 5.1.18, single user mode, Nodegroup: 0, Master)
id=6    @192.168.0.102  (Version: 5.1.18, single user mode, Nodegroup: 0)
id=7    @192.168.0.103  (Version: 5.1.18, single user mode, Nodegroup: 0)
id=8    @192.168.0.102  (Version: 5.1.18, single user mode, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=1    @192.168.0.103  (Version: 5.1.18)
id=2    @192.168.0.102  (Version: 5.1.18)

[mysqld(API)]   6 node(s)
id=10   @192.168.0.103  (Version: 5.1.18)
id=11   @192.168.0.102  (Version: 5.1.18)
id=12 (not connected, accepting connect from any host)
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)

jon@rodan:/usr/local/mysql/bin>

Suggested fix:
Something like this, perhaps:

jon@rodan:/usr/local/mysql/bin> ./ndb_mgm -e "ENTER SINGLE USER MODE 10"
Connected to Management Server at: localhost:1186
Single user mode entered
Access is granted for API node 10 only.
jon@rodan:/usr/local/mysql/bin> ./ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     4 node(s)
id=5    @192.168.0.103  (Version: 5.1.18, single user mode, Nodegroup: 0, Master)
id=6    @192.168.0.102  (Version: 5.1.18, single user mode, Nodegroup: 0)
id=7    @192.168.0.103  (Version: 5.1.18, single user mode, Nodegroup: 0)
id=8    @192.168.0.102  (Version: 5.1.18, single user mode, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=1    @192.168.0.103  (Version: 5.1.18)
id=2    @192.168.0.102  (Version: 5.1.18)

[mysqld(API)]   6 node(s)
id=10   @192.168.0.103  (Version: 5.1.18, single user mode)
id=11   @192.168.0.102  (Version: 5.1.18, no DML ops allowed)
id=12 (not connected, accepting connect from any host, no DML ops allowed)
id=13 (not connected, accepting connect from any host, no DML ops allowed)
id=14 (not connected, accepting connect from any host, no DML ops allowed)
id=15 (not connected, accepting connect from any host, no DML ops allowed)
[7 Sep 2007 12:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/33903

ChangeSet@1.2550, 2007-09-07 20:32:57+08:00, Justin.He@dev3-240.dev.cn.tlan +6 -0
  Bug#27999, Single User Mode: Management client should show API permitted to connect
[12 Sep 2007 16:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/34099

ChangeSet@1.2479, 2007-09-12 13:59:57+00:00, justin.he@turbo.localdomain +6 -0
  Bug#27999 Single user mode: Management client should show API permitted to connect
[13 Sep 2007 3:31] Stewart Smith
From a (very) quick look, instead of "no DML" should be something like "no DML or DDL" or "no operations allowed" as DDL is also prohibited in single user mode.

Would like to have closer look next week before approving though, only glanced today
[30 Sep 2007 8:29] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/34687

ChangeSet@1.2483, 2007-09-30 16:10:43+08:00, Justin.He@dev3-240.dev.cn.tlan +6 -0
  Bug#27999 Single User Mode: Management client should show API permitted to connect
[12 Oct 2007 5:21] Stewart Smith
sent a few comments to list
[2 Mar 2010 14:13] Jon Stephens
This was pushed but never put into Documenting status. (Easily verified with any recent Cluster build.)
[2 Mar 2010 16:09] Jon Stephens
Documented in the NDB-6.2.8 and 6.3.6 changelogs as follows:

      The output of the ndb_mgm client SHOW and STATUS commands now 
      indicates when the cluster is in single user mode. 

Also noted in docs covering ndb_mgm client commands.

Closed.