Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnumToString filter URL is not properly configured with MySQL schema name #336

Closed
GoogleCodeExporter opened this issue Aug 23, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1.  Set up direct replication with enumtostring filter enabled as shown in the 
following example: 

tools/tungsten-installer --direct -a \
  --master-host=logos1  \
  --master-user=tungsten  \
  --master-password=secret  \
  --slave-host=logos2 \
  --slave-user=tungsten  \
  --slave-password=secret  \
  --service-name=direct \
  --home-directory=/opt/continuent \
  --svc-parallelization-type=disk \
  --channels=1 \
  --mysql-use-bytes-for-string=false \
  --svc-extractor-filters=enumtostring \
  --skip-validation-check=MySQLConfigFileCheck \
  --skip-validation-check=MySQLApplierServerIDCheck \
  --skip-validation-check=MySQLExtractorServerIDCheck \
  --start-and-report 

What is the expected output?

Replication should install and go online. 

What do you see instead?

Replicator installation succeeds but replicator comes up in ONLINE-ERROR state. 
 The trepsvc.log file contains the following (ugly) stack trace: 

INFO   | jvm 1    | 2012/05/28 11:18:48 | 2012-05-28 11:18:48,496 [direct - 
pool-2-thread-1] ERROR conf.ReplicatorRuntime Unable to prepare plugin: class 
name=com.continuent.tungsten.replicator.filter.EnumToStringFilter
INFO   | jvm 1    | 2012/05/28 11:18:48 | 
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
java.lang.String.substring(String.java:1949)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
org.drizzle.jdbc.JDBCUrl.parse(JDBCUrl.java:96)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
org.drizzle.jdbc.DrizzleDriver.connect(DrizzleDriver.java:81)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
java.sql.DriverManager.getConnection(DriverManager.java:620)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
java.sql.DriverManager.getConnection(DriverManager.java:200)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.database.AbstractDatabase.connect(AbstractDat
abase.java:169)INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.database.MySQLDatabase.connect(MySQLDatabase.
java:119)INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.database.MySQLDatabase.connect(MySQLDatabase.
java:106)INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.filter.EnumToStringFilter.prepare(EnumToStrin
gFilter.java:169)INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.conf.ReplicatorRuntime.preparePlugin(Replicat
orRuntime.java:1086)INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.pipeline.StageTaskGroup.prepare(StageTaskGrou
p.java:187)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.pipeline.Stage.prepare(Stage.java:255)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.pipeline.Pipeline.prepare(Pipeline.java:245)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.conf.ReplicatorRuntime.prepare(ReplicatorRunt
ime.java:561)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.management.tungsten.TungstenPlugin.online(Tun
gstenPlugin.java:333)
INFO   | jvm 1    | 2012/05/28 11:18:48 |   at 
com.continuent.tungsten.replicator.management.OpenReplicatorManager$OfflineToSyn
chronizingAction.doAction(OpenReplicatorManager.java:1235)
Etc.

If you manually correct the URL you may then find that the replicator schema 
has not been created. In direct replication the THL is created on the slave, 
not the master.  You must then issue a CREATE DATABASE command to create the 
schema. 

What is the possible cause?

The URL for enumtostring lacks a schema name and an option to create the DB 
automatically.   It just has the host and port name. 

replicator.filter.enumtostring.url=jdbc:mysql:thin://${replicator.global.extract
.db.host}:${replicator.global.extract.db.port}

What is the proposed solution?

Add the schema name to the url as follows in enumtostring.tpl (template file 
for generating this filter): 

replicator.filter.enumtostring.url=jdbc:mysql:thin://${replicator.global.extract
.db.host}:${replicator.global.extract.db.port}/${replicator.schema}?createDB=tru
e

Additional information

You can work around this failure by adding the aforesaid URL updates to your 
static-svc.properties file and restarting the replicator.  

Use labels and text to provide additional information.

Original issue reported on code.google.com by robert.h...@continuent.com on 28 May 2012 at 6:55

@GoogleCodeExporter
Copy link
Author

This is now corrected by SVN rev 898.  

Original comment by robert.h...@continuent.com on 28 May 2012 at 7:01

@GoogleCodeExporter
Copy link
Author

Original comment by robert.h...@continuent.com on 20 Sep 2012 at 5:13

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by robert.h...@continuent.com on 15 Oct 2012 at 3:51

  • Added labels: Publish-Release-Note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant