Bug #31542 ndb_mgm -e "all report mem" does not print output to stdout
Submitted: 11 Oct 2007 19:25 Modified: 3 Mar 2010 11:31
Reporter: Oli Sennhauser Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: 5.1.22-ndb-6.2.6

[11 Oct 2007 19:25] Oli Sennhauser
Description:
ndb_mgm -e "command" should usualy run the command and print the output to stdout/errorout.

ndb_mgm -e "all report mem" does no. This is sad because we need it at customer for parsing the output for monitoring.

How to repeat:
# 5.1.22-ndb-6.2.6

# ndb_mgm -e "help help"
---------------------------------------------------------------------------
 NDB Cluster -- Management Client -- Help for HELP command
---------------------------------------------------------------------------
HELP List available commands of NDB Cluster Management Client

HELP               List available commands.

# ndb_mgm -e "all report mem"
Connected to Management Server at: localhost:1186
--> no output

# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> all report mem
Connected to Management Server at: localhost:1186

ndb_mgm> Node 2: Data usage is 0%(3 32K pages of total 4096)
Node 2: Index usage is 0%(8 8K pages of total 8224)
Node 3: Data usage is 0%(3 32K pages of total 4096)
Node 3: Index usage is 0%(8 8K pages of total 8224)

Suggested fix:
output should be sent to stdout/errout
[17 Oct 2007 10:37] Bogdan Kecman
bug is real.. 
I have tried it also on: mysqlcom-5.1.22-ndb-6.3.4-telco

example:
When I miss the report type I get error
[root@gedora bin]# ./ndb_mgm -c localhost -e "all report xxxx"
Connected to Management Server at: localhost:1186
  'xxxx' - report type specifier unknown or ambiguous
  'xxxx' - report type specifier unknown or ambiguous
[root@gedora bin]#

When I write it correctly I get nothing:
[root@gedora bin]# ./ndb_mgm -c localhost -e "all report mem"
Connected to Management Server at: localhost:1186
[root@gedora bin]#

workaround:
echo all report mem | ./ndb_mgm

example:
[root@gedora bin]# echo all report mem | ./ndb_mgm -c localhost
-- NDB Cluster -- Management Client --
Connected to Management Server at: localhost:1186

Node 2: Data usage is 1%(42 32K pages of total 2560)
Node 2: Index usage is 0%(21 8K pages of total 2336)
Node 3: Data usage is 1%(42 32K pages of total 2560)
[root@gedora bin]# 

--
Bogdan Kecman, Support Engineer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification
[26 Oct 2007 10:24] Oli Sennhauser
Hi Bogdan

Unfortunately your Workaround does not work. You are missing one row!!!

This is the output with your workaround:

echo "all report mem" | ndb_mgm
-- NDB Cluster -- Management Client --
Connected to Management Server at: localhost:1186

Node 2: Data usage is 0%(3 32K pages of total 2048)

And this is the output like it should look like:

# ndb_mgm
ndb_mgm> all report mem
Connected to Management Server at: localhost:1186

ndb_mgm> Node 2: Data usage is 0%(3 32K pages of total 2048)
Node 2: Index usage is 0%(6 8K pages of total 4128)
Node 3: Data usage is 0%(3 32K pages of total 2048)
Node 3: Index usage is 0%(6 8K pages of total 4128)
Node 4: Data usage is 0%(3 32K pages of total 2048)
Node 4: Index usage is 0%(6 8K pages of total 4128)
Node 5: Data usage is 0%(3 32K pages of total 2048)
Node 5: Index usage is 0%(6 8K pages of total 4128)

You have probably overseen this in your work around.
[29 Nov 2007 16:05] Jon Stephens
ndb_mgm -e "all report backupstatus" also does not produce any output to stdout.

Confirmed with mysql-5.1.22-ndb-6.2.10 and mysql-5.1.22-ndb-6.3.7 from bk.
[25 Jun 2008 14:26] Johan Andersson
Can we fix this sometime?!?!
[4 Nov 2008 21:09] Hartmut Holzgraefe
The ndb_mgm binary probably terminates after sending the DUMP/REPORT request before receiving the associated events back completely or even at all, so adding code waiting for the known good nodes to return the requested data before terminating should help?
[12 Dec 2008 13:07] Jon Stephens
Bug#39834 and Bug#41432 are duplicates of this bug.
[14 May 2009 15:39] Daniel Herlitz
This is what we do as a workaround:

printf "all report MemoryUsage\nall report MemoryUsage\n" | ndb_mgm -c X

but it would be great to be able to expect a reliably output from to -e option.
[19 May 2009 9:09] Jon Stephens
BUG#39977 is a duplicate of this bug.
[20 Nov 2009 15:46] Jonathan Gibert
seriously, still no fix ?
[22 Feb 2010 9:45] 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/101034
[2 Mar 2010 9:17] 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/102002
[2 Mar 2010 9: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/102005
[2 Mar 2010 17:59] Bugs System
Pushed into 5.1.41-ndb-7.0.14 (revid:magnus.blaudd@sun.com-20100302174920-7j3bpj5kjfg54b69) (version source revid:magnus.blaudd@sun.com-20100302171239-97hayyf3l0q2rrz3) (merge vers: 5.1.41-ndb-7.0.14) (pib:16)
[2 Mar 2010 18:00] Bugs System
Pushed into 5.1.41-ndb-6.3.33 (revid:magnus.blaudd@sun.com-20100302171238-yphjt5qcs8epldzm) (version source revid:magnus.blaudd@sun.com-20100302171238-yphjt5qcs8epldzm) (merge vers: 5.1.41-ndb-6.3.33) (pib:16)
[3 Mar 2010 10:14] Magnus Blåudd
Pushed to 6.3.33, 7.0.14 and 7.1.2-beta
[3 Mar 2010 11:31] Jon Stephens
Documented bugfix in the NDB-6.3.33, 7.0.14, and 7.1.2 changelogs, as follows:

      ndb_mgm -e "... REPORT ..." did not write any output to stdout.

Closed.
[3 Mar 2010 12:36] Jon Stephens
Added to changelog entry:

        The fix for this issue also prevents the cluster log from being 
        flooded with INFO messages when DataMemory usage reaches 100%, and 
        insures that when when the usage is decreased, an appropriate message 
        is written to the cluster log.