Bug #22773 NDB_LE_Connected sent when it should be NDB_LE_Disconnected
Submitted: 28 Sep 2006 8:34 Modified: 28 Dec 2006 13:41
Reporter: Johan Andersson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S4 (Feature request)
Version:5.0, 5.1 OS:Any (*)
Assigned to: Jonas Oreland CPU Architecture:Any

[28 Sep 2006 8:34] Johan Andersson
Description:

When a data node is shutdown (with ndb_mgm -e "3 stop"), then the mgmtserver reports a "NDB_LE_Connected" event on node 3! Very confusing and very difficult to monitor what has actually happened (to raise and clear alarms) when building monitoring applications using the mgmapi...

I have a cluster looking like this (but this bug is valid also if you only have one ndb_mgmd):

johan@stingray:~$ ndb_mgm localhost:1186 -e "show"
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=3    @127.0.0.1  (Version: 5.1.12, Nodegroup: 0, Master)
id=4    @127.0.0.1  (Version: 5.1.12, Nodegroup: 0)

[ndb_mgmd(MGM)] 2 node(s)
id=1    @127.0.0.1  (Version: 5.1.12)
id=2    @127.0.0.1  (Version: 5.1.12)

[mysqld(API)]   3 node(s)
id=5    @127.0.0.1  (Version: 5.1.12)
id=6 (not connected, accepting connect from any host)
id=7 (not connected, accepting connect from any host)

How to repeat:

* compile ndbapi_example/mgmapi_logevent:
cd ndbapi_example/mgmapi_logevent:
make

* start a cluster
* start the mgmapi_logevent program
./mgmapi_logevent

ndb_mgm -e "3 stop"

mgmapi_logevent prints out:
Node 1: Connected: node 3     <------- problematic to handle.
Node 4: Disconnected: node 3

Suggested fix:

It would be good if node 1 generates the disconnect event... and handles error (to setup a new connection to the failing node) by generating a new type of Log Event.
[6 Dec 2006 12: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/16509

ChangeSet@1.2277, 2006-12-06 13:09:30+01:00, jonas@perch.ndb.mysql.com +1 -0
  ndb - bug#22773
    Fix correct log event on db-node disconnect
[6 Dec 2006 12:40] Jonas Oreland
pushed into 5.0-ndb and 5.1-ndb
[27 Dec 2006 17:41] Tomas Ulin
pushed to 5.1.15
[28 Dec 2006 9:44] Tomas Ulin
pushed to 5.0.34
[28 Dec 2006 13:41] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix for 5.0.34 and 5.1.15.
[4 Jan 2007 11:55] 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/17622