Bug #76783 Fabric can't auto switch DB Node
Submitted: 22 Apr 2015 7:17 Modified: 23 Apr 2015 13:49
Reporter: cnhome sdf (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.35 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[22 Apr 2015 7:17] cnhome sdf
Description:
I have set up one backing store, one master database, and one slave database. 

If both Master and Slave DB are up, everything go fine. 
However, when I take down the Master, Fabric promoted the slave to the new Master, the client cannot read and write through Fabric. It seems that Fabric cannot update the cached route in the client's MySQL connector. 

How to repeat:
1.Set up one backing store, one master database, and one slave database. 
2.Start both Master and Slave DB;
3.Take down the Master, Fabric promoted the slave to the new Master
4.the client cannot read and write through Fabric.

Suggested fix:
There are something wrong in the method,com.mysql.jdbc.ReplicationConnectionGroup.registerReplicationConnection(). 

public long registerReplicationConnection(ReplicationConnection conn, List<String> localMasterList, List<String> localSlaveList) { 
long currentConnectionId; 

synchronized (this) { 
if (!this.isInitialized) { 
if (localMasterList != null) { 
this.masterHostList.addAll(localMasterList); 
} 
if (localSlaveList != null) { 
this.slaveHostList.addAll(localSlaveList); 
} 
this.isInitialized = true; 
} 
currentConnectionId = ++this.connections; 
this.replicationConnections.put(Long.valueOf(currentConnectionId), conn); 
} 
this.activeConnections++; 

return currentConnectionId; 

} 
This method can't change anything when fabric changed the master node.
[23 Apr 2015 13:49] Jess Balint
Thank you for your interest in MySQL Fabric. This is a duplicate of Bug#75113. Please track the progress there.