Bug #52772 ClusterJ requires *all* data nodes to be up
Submitted: 12 Apr 2010 19:15 Modified: 5 May 2010 16:37
Reporter: John David Duncan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster/J Severity:S3 (Non-critical)
Version:7.1.3 OS:Any
Assigned to: Craig Russell CPU Architecture:Any

[12 Apr 2010 19:15] John David Duncan
Description:
Cluster/J will not connect to a cluster unless all data nodes are up.  But it should also connect if, say, one node is down for maintenance.

The problem is in ClusterConnectionImpl.java.

The return values from wait_until_ready() are:
  0: all data nodes are up
  n (n>0): n data nodes are up, but not all nodes
  < 0: error

However, the Java code here requires a return value of 0. 

How to repeat:
(See description)

Suggested fix:
 ClusterConnectionImpl.java :

     public void waitUntilReady(int connectTimeoutBefore, int connectTimeoutAfter) {
         int returnCode = clusterConnection.wait_until_ready(connectTimeoutBefore, connectTimeoutAfter);
-        handleError(returnCode, clusterConnection);
+        if (returnCode < 0) 
+            handleError(returnCode, clusterConnection);
     }
 
     protected static void handleError(int returnCode, Ndb_cluster_connection clusterConnection) {
[14 Apr 2010 21:54] Craig Russell
Pushed fix to bzrroot clusterj tree.

Using saved parent location: bzr+ssh://crussell@bk-internal.mysql.com/bzrroot/clusterj/
 M  clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java
 M  clusterj-tie/src/main/resources/com/mysql/clusterj/tie/Bundle.properties
All changes applied successfully.
Now on revision 253.
[5 May 2010 16:37] Craig Russell
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