Details
-
Type:
Bug
-
Status: Closed
-
Resolution: Not a Bug
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
The problem was initially reported in Tungsten replicator backtracking system as http://code.google.com/p/tungsten-replicator/issues/detail?id=256. It says that Tungsten fails while asking for a binlog dump.
From what I see after installing Tungsten and running connection tests with it, the problem is not related to binlog dump.
Tungsten uses two kinds of url-s to connect to the database: usually it connects as
"jdbc:mysql:thin://<host>:<port>/<schema>?createDB=true",
but sometimes as
"jdbc:mysql:thin://<host>:<port>/".
The latter fails on 5.2.8 and higher (and on 5.3, too), with the "bad handshake" error. On 5.2.7 both lines work fine. 5.1.60 looks okay too.
My wild guess is that it's somehow related to client plugin authentication, namely to a corner
case when server on some reason thinks the client is using plugin authentication while in fact it does not. It's pure speculation though.
I've attached a simple Java test case that uses the same classes as Tungsten for database connection, but does not do anything else. The tarball contains everything (apart from java itself) needed to run the test case – the compiled test, libraries and the runner. Extract the archive, cd into the 'test' folder, launch ./run (you need to have your DB server already running). If you are using a port other than 3306, edit the 'run' file to add -Dport=<port> property to run the java class.
The test code is below.
Test case:
import com.continuent.tungsten.replicator.database.DatabaseFactory;
import com.continuent.tungsten.replicator.database.Database;
import java.sql.SQLException;
public class test
{
public static void main (String argv[])
{
try
{
String port = System.getProperty("port");
if (port == null)
String conLine1 = "jdbc:mysql:thin://localhost:"port"/tungsten_logos?createDB=true";
String conLine2 = "jdbc:mysql:thin://localhost:"port"/";
System.out.println("\nConnecting with " + conLine1 + "\n");
System.out.println("(Do not pay attention to log4j complaints)");
Database conn1 = DatabaseFactory.createDatabase(conLine1, "root", "");
conn1.connect();
System.out.println("\nLooks OK...");
System.out.println("Now connecting with " + conLine2);
Database conn2 = DatabaseFactory.createDatabase(conLine2,"root","");
try
catch (SQLException e)
{ System.out.println("This is the error we are looking for:"); System.out.println(e + "\n"); } }
catch (Exception e)
}
}
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Test code, class and libraries
LPexportBug904097_test.tar.gz