Bug #40597 --ndb-shm server option doesn't set any server or status variables
Submitted: 9 Nov 2008 12:01 Modified: 5 May 2010 20:34
Reporter: Jon Stephens Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: --ndb-shm, ndbcluster, server options
Triage: Triaged: D4 (Minor) / R1 (None/Negligible) / E1 (None/Negligible)

[9 Nov 2008 12:01] Jon Stephens
Description:
From sql/mysqld.cc:

  {"ndb-shm", OPT_NDB_SHM,
   "Use shared memory connections when available.",
   (uchar**) &opt_ndb_shm,
   (uchar**) &opt_ndb_shm,
   0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0},

You can set this server option, but doing so does not set any server variables or status variables.

How to repeat:
Start MySQL server with option (any of the following):

> ./mysqld_safe --ndbcluster --ndb-connectstring=127.0.0.1 --ndb-shm &
> ./mysqld_safe --ndbcluster --ndb-connectstring=127.0.0.1 --ndb-shm=1 &
> ./mysqld_safe --ndbcluster --ndb-connectstring=127.0.0.1 --ndb-shm=0 &

Start client, run SHOW VARIABLES/SHOW STATUS:

> ./mysql -uroot
mysql> show variables like '%ndb%';
mysql> show status like '%ndb%';
mysql> show global status like '%ndb%';
mysql> show variables like '%shm%';
mysql> show status like '%shm%';
mysql> show global status like '%shm%';

Observe output: no ndb_shm, Ndb_shm, etc.

mysql> SELECT @@ndb_shm;
ERROR 1193 (HY000): Unknown system variable 'ndb_shm'

Suggested fix:
Set Ndb_shm and make it show up in SHOW VARIABLES or SHOW STATUS as appropriate.
[12 Nov 2008 14:24] Jonas Oreland
--ndb-shm is not really supported
i suggest we remove it, until we get shm *really* supported
E1: if only removing it from mysqld (E2 if removing it from configure aswell)
R1: no risk
[5 Feb 2009 9:19] Jon Stephens
I've removed --ndb-shm from the documentation.

I'd still like to see it removed from the code as well (unless we plan to enable it sometime relatively soon).
[14 Apr 2010 9:01] Magnus Blåudd
The only place where --ndb-shm currently has any effect is in ndb_mgmd when it's generating the config, it  will "magically" use SHM connection instead of TCP connection if the hostname of two nodes are the same.

1) It should be removed from all programs except ndb_mgmd since it has no effect unless the ndb_mgmd was started with --ndb-shm.

2) This is an experimental feature which is not working -> remove it completely.
[14 Apr 2010 9:59] Magnus Blåudd
The configure part will be left as is. There is no switch for --ndb-shm to configure, instead it will simply autodetect if all the necessary functions for necessary for the SHM transporter is available and in such a case build it.
[30 Apr 2010 9:09] 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/107040
[30 Apr 2010 9:28] 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/107048
[5 May 2010 9:38] Bugs System
Pushed into 5.1.44-ndb-7.0.15 (revid:magnus.blaudd@sun.com-20100505093008-81x1i3vzcyrq1y4o) (version source revid:magnus.blaudd@sun.com-20100505093008-81x1i3vzcyrq1y4o) (merge vers: 5.1.44-ndb-7.0.15) (pib:16)
[5 May 2010 10:21] Magnus Blåudd
Pushed to 7.0.15 and 7.1.4
[5 May 2010 20:34] Jon Stephens
Option already removed from the documentation, no changelog entry needed.

Closed.