Bug #11459 ndb status variables not updated
Submitted: 20 Jun 2005 15:43 Modified: 4 Jul 2006 6:39
Reporter: Stewart Smith
Status: Closed
Category:Server: Cluster Severity:S3 (Non-critical)
Version:5.0.7 OS:
Assigned to: Stewart Smith Target Version:

[20 Jun 2005 15:43] Stewart Smith
Description:
NDB status variables are not updated.

for example, when mgm servers change.

How to repeat:
start cluster (with 1/2 mgm nodes)
start mysqld
stop cluster
start cluster with different management node being active
examine variables

Suggested fix:
call update_status_variables in ha_ndbcluster.cc when things change.

Also have complete connectstring as a variable.
[26 Jun 2006 6:46] Stewart Smith
It's interesting (read: good) that these status variables
SHOW STATUS LIKE "ndb%"
aren't documented.

However, the main problem with them is not that they're not updated, but that they're
named poorly.

We're not reporting connected host and port at all. We're reporting the management server
we first connected to which we fetched the configuration from. This is probably more
valuable than which management servers we can currently contact (this should possibly be
reported elsewhere - but isn't).

The other variables: node id and number of storage nodes both cannot change while the
mysql server is up, so there is no problem in not updating these either.

If we do want real status information, we should add variables/tables with this
information.

I propose a patch similar to the following:
===== sql/ha_ndbcluster.cc 1.262 vs edited =====
--- 1.262/sql/ha_ndbcluster.cc  2006-06-21 17:50:32 +10:00
+++ edited/sql/ha_ndbcluster.cc 2006-06-23 16:52:18 +10:00
@@ -160,8 +160,8 @@

 struct show_var_st ndb_status_variables[]= {
   {"cluster_node_id",        (char*) &ndb_cluster_node_id,         SHOW_LONG},
-  {"connected_host",         (char*) &ndb_connected_host,      SHOW_CHAR_PTR},
-  {"connected_port",         (char*) &ndb_connected_port,          SHOW_LONG},
+  {"config_from_host",         (char*) &ndb_connected_host,      SHOW_CHAR_PTR},
+  {"config_from_port",         (char*) &ndb_connected_port,          SHOW_LONG},
 //  {"number_of_replicas",     (char*) &ndb_number_of_replicas,      SHOW_LONG},
   {"number_of_storage_nodes",(char*) &ndb_number_of_storage_nodes, SHOW_LONG},
   {NullS, NullS, SHOW_LONG}
[26 Jun 2006 15:31] 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/8244
[26 Jun 2006 15:33] Stewart Smith
tomas approved
[28 Jun 2006 14:30] Stewart Smith
pushed to team trees 4.1, 5.0 and 5.1
[29 Jun 2006 11:51] Tomas Ulin
pushed to 5.1.12
[29 Jun 2006 14:04] Stewart Smith
Pushed to 5.0.23 and 5.1.12
[4 Jul 2006 6:39] Jon Stephens
Documented bugfix in 5.0.23/5.1.12 changelogs.

Documented NDB status variables in Manual.

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

Verified with Stewart that this push doesn't affect 4.1 (status variables aren't supported
before 5.0).