is00hcw / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 1 forks source link

trepctl consistency command generates misleading error if connection fails #961

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Set up a Tungsten master extracting from MySQL. 
2. Issue a consistency check on a large table so that it runs for a long period 
of time. 
3. Terminate the consistency check connection from within MySQL using a kill 
command. 

What is the expected output?

Replicator should show that the consistency check failed. 

What do you see instead?

Replicator creates a stack trace that indicates it could not close the 
connection.  

INFO   | jvm 1    | 2014/06/26 19:14:37 | 2014-06-26 19:14:37,217 [ - RMI TCP 
Connection(13372)-10.159.23.246] ERROR management.tungsten.TungstenPlugin 
Consistency check transaction (ID: 5952; TABLE: timeincsimr.url_alias, LIMITS: 
-1, -1) failed: Consistency check failed: Could not read resultset: Incomplete 
read! Expected 4, got -1
INFO   | jvm 1    | 2014/06/26 19:14:37 | 2014-06-26 19:14:37,217 [ - RMI TCP 
Connection(13372)-10.159.23.246] WARN  database.AbstractDatabase Unable to 
close connection
INFO   | jvm 1    | 2014/06/26 19:14:37 | 
java.sql.SQLNonTransientConnectionException: Could not close connection: Broken 
pipe
INFO   | jvm 1    | 2014/06/26 19:14:37 | at 
org.drizzle.jdbc.internal.SQLExceptionMapper.get(SQLExceptionMapper.java:97)
INFO   | jvm 1    | 2014/06/26 19:14:37 | at 
org.drizzle.jdbc.DrizzleConnection.close(DrizzleConnection.java:223)
INFO   | jvm 1    | 2014/06/26 19:14:37 | at 
com.continuent.tungsten.replicator.database.AbstractDatabase.disconnect(Abstract
Database.java:193)
INFO   | jvm 1    | 2014/06/26 19:14:37 | at 
com.continuent.tungsten.replicator.database.AbstractDatabase.close(AbstractDatab
ase.java:800)
INFO   | jvm 1    | 2014/06/26 19:14:37 | at 
com.continuent.tungsten.replicator.management.tungsten.TungstenPlugin.consistenc
yCheck(TungstenPlugin.java:278)
INFO   | jvm 1    | 2014/06/26 19:14:37 | at 
com.continuent.tungsten.replicator.management.OpenReplicatorManager.consistencyC
heck(OpenReplicatorManager.java:2418)
...etc...

What is the possible cause?

The consistency check logic in method TungstenPlugin.consistencyCheck() closes 
the connection without checking for errors. Here is the offending code: 

        finally
        {
            conn.close();
        }
        return id;

This generates an exception that masks previous errors. 

What is the proposed solution?

Add guard against exceptions when cleaning up from call. 

Additional information

The heartbeat call has the same problem.  See method 
com.continuent.tungsten.replicator.heartbeat.HeartbeatTable.startHeartbeat(Strin
g, String, String, String, String).  This should be fixed. 

Use labels and text to provide additional information.

Original issue reported on code.google.com by robert.h...@continuent.com on 28 Jun 2014 at 4:52

GoogleCodeExporter commented 9 years ago

Original comment by robert.h...@continuent.com on 12 Aug 2014 at 3:35

GoogleCodeExporter commented 9 years ago

Original comment by linas.vi...@continuent.com on 19 Jan 2015 at 2:18