环境信息
canal 1.1.6 mysql 5.7
问题描述
canal 实例从非GTID模式切换到GTID模式,会导至实例同步失败,无法继续进行同步操作
重现步骤
期待实现
实例可以正常运行
实际执行情况
实例失败,重启也失败,必须要删除h2.mv.db及meta.dat文件才能正常运行。
会出现两种异常
ERROR c.a.o.canal.parse.inbound.mysql.dbsync.DirectLogFetcher - I/O error while reading from client socket java.io.IOException: EOF encountered. at com.alibaba.otter.canal.parse.driver.mysql.socket.BioSocketChannel.read(BioSocketChannel.java:113) ~[canal.parse.driver-1.1.6.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch0(DirectLogFetcher.java:170) ~[canal.parse-1.1.6.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:77) ~[canal.parse-1.1.6.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:262) [canal.parse-1.1.6.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:255) [canal.parse-1.1.6.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]
或 Caused by: com.alibaba.fastjson2.JSONException: read field error : clientDatas at com.alibaba.fastjson2.reader.FieldReaderObjectMethod.readFieldValue(FieldReaderObjectMethod.java:92) ~[fastjson2-2.0.4.jar:na] at com.alibaba.fastjson2.reader.ObjectReader2.readObject(ObjectReader2.java:241) ~[fastjson2-2.0.4.jar:na] at com.alibaba.fastjson2.JSON.parseObject(JSON.java:258) ~[fastjson2-2.0.4.jar:na] at com.alibaba.otter.canal.common.utils.JsonUtils.unmarshalFromString(JsonUtils.java:51) ~[canal.common-1.1.6.jar:na] at com.alibaba.otter.canal.meta.FileMixedMetaManager.loadDataFromFile(FileMixedMetaManager.java:175) ~[canal.meta-1.1.6.jar:na] at com.alibaba.otter.canal.meta.FileMixedMetaManager.loadClientIdentity(FileMixedMetaManager.java:225) ~[canal.meta-1.1.6.jar:na] at com.google.common.collect.MigrateMap$1.load(MigrateMap.java:23) ~[canal.common-1.1.6.jar:na] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708) ~[guava-22.0.jar:na] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416) ~[guava-22.0.jar:na] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) ~[guava-22.0.jar:na] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) ~[guava-22.0.jar:na]
原提问者GitHub用户qq664042
这个问题已经找到根源了,换成canal-1.1.6-hotfix-1版本的可以修复此问题。
原回答者GitHub用户qq664042
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。