zendesk / maxwell

Maxwell's daemon, a mysql-to-json kafka producer
https://maxwells-daemon.io/
Other
4.04k stars 1.01k forks source link

Problem reconnecting Maxwell agent after database relocation #1042

Open hbpro opened 6 years ago

hbpro commented 6 years ago

Hey guys, I've deployed Maxwell in order to publish data changes from MariaDB to Kafka, however, after relocating MariaDB instance container (binary log path hasn't been changed), I got this error while running the maxwell agent:

java.lang.RuntimeException: Couldn't find table #mysql50##sql-1_13c1eb8 in database mydatabase
    at com.zendesk.maxwell.replication.TableCache.processEvent(TableCache.java:29) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.replication.BinlogConnectorReplicator.getTransactionRows(BinlogConnectorReplicator.java:189) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.replication.BinlogConnectorReplicator.getRow(BinlogConnectorReplicator.java:281) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.replication.AbstractReplicator.work(AbstractReplicator.java:148) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.util.RunLoopProcess.runLoop(RunLoopProcess.java:27) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.Maxwell.startInner(Maxwell.java:190) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.Maxwell.start(Maxwell.java:140) ~[maxwell-1.11.0.jar:?]
    at com.zendesk.maxwell.Maxwell.main(Maxwell.java:211) ~[maxwell-1.11.0.jar:?]

I droped the maxwell database and double-checked the database binary log settings (even reseting the binary log) and maxwell db user permissions, but still no luck. Any suggestions are welcomed. Thanks,

liulikun commented 6 years ago

Do you have a table named #mysql50##sql-1_13c1eb8? That seems an invalid table name.

hbpro commented 6 years ago

No, I don't have. This is my command:

/root/maxwell-1.11.0/bin/maxwell --user='maxwell' --password='********' --host='192.168.100.1' --port=3306 --include_dbs=my_database --include_tables=tb1,tb2 --producer=kafka --kafka.bootstrap.servers=localhost:9092

liulikun commented 6 years ago

You mentioned you've dropped maxwell database completely? That should've cleaned everything up. Not sure what could go wrong. You could also try adding this option to your command: --recapture_schema=true, that'll recapture schema again when maxwell starts. If it works, then you can remove this option from the command.

hbpro commented 6 years ago

No improvement, still getting the same error

hbpro commented 6 years ago

Is there any kinda relay log file or database except 'Maxwell' database?

liulikun commented 6 years ago

Forgot to mention, to use --recapture_schema=true, you need to upgrade maxwell to 1.16.1 or later. There are no relay log files or databases apart from maxwell.

hbpro commented 6 years ago

Yes, I have upgraded it to maxwell-1.17.1 but the same problem arises.

hbpro commented 6 years ago

I even changed the target database --include_dbs=other_database but the error indicates the previous database and this weird table #mysql50##sql-1_13c1eb8

osheroff commented 6 years ago

It looks like a temp table to me. Probably something different between mariaDb and MySQL: I think MySQL never replicates the rows of a temp table. I’d be willing to put in a fix for this, but would need a reliable repro.

On Jul 4, 2018, at 07:41, Hossein Bakhtiari notifications@github.com wrote:

I even changed the target database --include_dbs=other_database but the error indicates the previous database and this weird table #mysql50##sql-1_13c1eb8

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.