Bug #30829 ndb_mgm SHOW output should list current arbitrator
Submitted: 5 Sep 2007 12:21 Modified: 2 May 2013 8:48
Reporter: Kai Voigt Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: Versions = all

[5 Sep 2007 12:21] Kai Voigt
Description:
make the SHOW output display the current arbitrator. It's a mess to find it in the cluster log.

How to repeat:
run SHOW inside ndb_mgm and see there's no arbitrator listed
[5 Sep 2007 12:31] Kai Voigt
any version
[5 Sep 2007 12:37] Jon Stephens
This would be very useful IMO.
[4 Dec 2009 13:43] Geert Vanderkelen
Attempt to add ALL DUMP 2599 to show the Arbitrator in ndb_mgm client

Attachment: bug30829_dump2599.patch (application/octet-stream, text), 1.98 KiB.

[4 Dec 2009 13:46] Geert Vanderkelen
I've upload a patch (against 7.0.9b) which is a first attempt to implement a DUMP for showing which node is the arbitrator. Showing it in the cluster logs is quite easy, with an infoEvent(), but trying sendSignal(), I can't catch the event using management API or ndb_mgm client.

The idea is:
 ndb_mgm> ALL REPORT ARBITRATOR
 Current Arbitrator has node ID <nodeid>

This almost done, just that I could not find why the signal is not getting through.
It's not part of the SHOW output as the feature requests wants, but it's a first step into that direction.
[7 Dec 2009 9:19] Geert Vanderkelen
Second attempt (using ArbitState..)

Attachment: bug30829_dump2599_v2.patch (application/octet-stream, text), 2.86 KiB.

[7 Dec 2009 12:19] Geert Vanderkelen
Third attempt, now works in logs as well as in MGM API and ndb_mgm client

Attachment: bug30829_dump2599_v3.patch (application/octet-stream, text), 3.98 KiB.

[7 Dec 2009 12:22] Geert Vanderkelen
The 3rd patch has the following effect:

* From the management client tool:
..
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]	1 node(s)
id=3	@127.0.0.1  (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0, Master)

[ndb_mgmd(MGM)]	1 node(s)
id=1	@127.0.0.1  (mysql-5.1.39 ndb-7.0.9)

[mysqld(API)]	5 node(s)
id=4	@127.0.0.1  (mysql-5.1.39 ndb-7.0.9)
id=5	@127.0.0.1  (mysql-5.1.39 ndb-7.0.9)
id=6 (not connected, accepting connect from any host)
id=7 (not connected, accepting connect from any host)
id=8 (not connected, accepting connect from any host)

ndb_mgm> ALL REPORT ARBITRATOR

ndb_mgm> Node 3: Current Arbitrator is 1

ndb_mgm> 

The ALL REPORT ARBITRATOR command will also log this it
in the cluster logs, like this:

2009-12-07 13:15:03 [MgmtSrvr] INFO     -- Node 3: Current arbitrator node 1

And of course, it works in MGM API:
$ ./ndb_arbitrator 
Current arbitrator node 1

Filter for NDB_MGM_EVENT_CATEGORY_INFO >=2 and send 2599 dump.

Woohoo!! :)
[7 Dec 2009 12:50] Geert Vanderkelen
Cleaning up, adding missing ndb_logevent.h, rename to DumpCurrentArbitrator(2599)

Attachment: bug30829_dump2599_v3.1.patch (application/octet-stream, text), 4.89 KiB.

[8 Dec 2009 9:53] 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/93139

3264 Geert Vanderkelen	2009-12-08
      Bug#30829: ndb_mgm SHOW output should list current arbitrator
      
      Implementing a new dump code which reports the current arbitrator by sending
      an ALL DUMP 2599 using the mgm client ool or MGM API. It reprots it
      - in the cluster logs and
      - in the mgm client tool using ALL REPORT ARBITRATOR
      modified:
        storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
        storage/ndb/include/mgmapi/ndb_logevent.h
        storage/ndb/src/common/debugger/EventLogger.cpp
        storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
        storage/ndb/src/mgmapi/ndb_logevent.cpp
        storage/ndb/src/mgmclient/CommandInterpreter.cpp
[2 May 2013 8:48] Magnus Blåudd
Information about arbitrator is available via the ndbinfo.membership table -
https://dev.mysql.com/doc/refman/5.5/en/mysql-cluster-ndbinfo-membership.html

Thus rejecting this feature request now.