开发者社区> 问答> 正文

timestamp类型解析有误

  • canal version canal 1.1.5
    • mysql version 10.0.25-MariaDB
    • kafka version 2.8.0

从MariaDB同步数据到Kafka

表:

CREATE TABLE temp_20220615_1 ( ID int(11) NOT NULL COMMENT 'ID', addDate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP() COMMENT '添加时间', updateDate timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() COMMENT '更新时间', PRIMARY KEY (ID) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE temp_20220615_2 ( ID int(11) NOT NULL COMMENT 'ID', addDate timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '添加时间', updateDate timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间', PRIMARY KEY (ID) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE temp_20220615_3 ( ID int(11) NOT NULL COMMENT 'ID', addDate timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '添加时间', updateDate timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间', PRIMARY KEY (ID) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

timestamp类型,如果为秒级别的,可以正常解析和消费,如果为timestamp(3)毫秒级别或者 timestamp(6)微秒级别,就会报错

2022-06-15 07:36:34.808 [destination = xxx , address = /x.x.x.x:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:col_album[com.alibaba.otter.canal.parse.exception.CanalParseException: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed. Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed. Caused by: java.lang.IllegalArgumentException: limit excceed: 21 at com.taobao.tddl.dbsync.binlog.LogBuffer.getUint32(LogBuffer.java:562) at com.taobao.tddl.dbsync.binlog.event.RowsLogBuffer.fetchValue(RowsLogBuffer.java:438) at com.taobao.tddl.dbsync.binlog.event.RowsLogBuffer.nextValue(RowsLogBuffer.java:125) at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parseOneRow(LogEventConvert.java:752) at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parseRowsEvent(LogEventConvert.java:566) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$DmlParserStage.onEvent(MysqlMultiStageCoprocessor.java:341) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$DmlParserStage.onEvent(MysqlMultiStageCoprocessor.java:327) at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:143) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

原提问者GitHub用户RankRao

展开
收起
白夜行fighting 2023-04-25 21:21:17 256 0
1 条回答
写回答
取消 提交回答
  • 升级下最新的1.1.7,修复过mysql和mariadb新版本的binlog解析串位问题

    原回答者GitHub用户agapple

    2023-04-26 18:02:58
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
神龙云服务器产品及技术深度解析 立即下载
弹性创造价值:基于ECS的最佳性价比实践解析 立即下载
又快又稳:阿里云下一代虚拟交换机解析 立即下载

相关镜像