Canal异常[errorNumber=1094, fieldCount=-1...]

1 篇文章 0 订阅
1 篇文章 0 订阅
在项目中遇到了Canal从MySQL获取binlog时出现的异常,具体表现为Canal解析rowdata失败,错误信息提示limit exceed。分析原因是由于MySQL系统表权限过高导致Canal无法读取相关表的binlog,从而无法正常移动位点。解决方案是在Canal配置中增加黑名单,过滤掉mysql库下的所有表,无需重启Canal即可恢复。参考链接提供了解决方案的详细步骤。
摘要由CSDN通过智能技术生成

项目中,遇到的Canal异常如下:

2021-07-14 09:57:30.501 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnecti
on to /localhost:3306...
2021-07-14 09:57:30.549 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initializat
ion packet received, prepare the client authentication packet to send
2021-07-14 09:57:30.549 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication
 packet is sent out.
2021-07-14 09:57:30.597 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - auth switch response 
packet is sent out.
2021-07-14 09:57:31.076 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.a.otter.canal.parse.inbound.mysql.MysqlConnection - Register slave RegisterSl
aveCommandPacket[reportHost=192.168.1.80,reportPort=40858,reportUser=case,reportPasswd=password,serverId=1560281089,command=21]
2021-07-14 09:57:31.124 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.a.otter.canal.parse.inbound.mysql.MysqlConnection - COM_BINLOG_DUMP with posi
tion:BinlogDumpCommandPacket[binlogPosition=4,slaveServerId=1560281089,binlogFileName=binlog.000022,command=18]
2021-07-14 09:57:31.196 [pool-4-thread-2] INFO  c.a.otter.canal.server.embedded.CanalServerWithEmbedded - getWithoutAck successfully, clientId:1001 batchSize:50  real size is 15 and result is
 [batchId:1 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,posit
ion=227,serverId=1,gtid=,timestamp=1626066389000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.
000022,position=12561,serverId=1,gtid=,timestamp=1626066755000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journ
alName=binlog.000022,position=12561,serverId=1,gtid=,timestamp=1626066755000]],endSeq=14]]
2021-07-14 09:57:31.197 [pool-4-thread-2] INFO  c.a.otter.canal.server.embedded.CanalServerWithEmbedded - ack successfully, clientId:1001 batchId:1 position:PositionRange[start=LogPosition[id
entity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=227,serverId=1,gtid=,timestamp=1626066389000]],ack=Lo
gPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=12561,serverId=1,gtid=,timestamp=16260667
55000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=12561,serverId=1,gtid=,time
stamp=1626066755000]],endSeq=14]
2021-07-14 09:57:31.298 [pool-4-thread-2] INFO  c.a.otter.canal.server.embedded.CanalServerWithEmbedded - getWithoutAck successfully, clientId:1001 batchSize:50  real size is 81 and result is
 [batchId:2 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,posit
ion=13685,serverId=1,gtid=,timestamp=1626066777000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlo
g.000022,position=70920,serverId=1,gtid=,timestamp=1626068949000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,jou
rnalName=binlog.000022,position=70920,serverId=1,gtid=,timestamp=1626068949000]],endSeq=95]]
2021-07-14 09:57:31.325 [destination = canal-staging-test , address = /localhost:3306 , EventParser] ERROR c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - dump address /120.25.22
5.226:3306 has an error, retrying. caused by 
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: 369
	at com.taobao.tddl.dbsync.binlog.LogBuffer.getUint8(LogBuffer.java:235)
	at com.taobao.tddl.dbsync.binlog.LogBuffer.getPackedLong(LogBuffer.java:1024)
	at com.taobao.tddl.dbsync.binlog.JsonDiffConversion.print_json_diff(JsonDiffConversion.java:48)
	at com.taobao.tddl.dbsync.binlog.event.RowsLogBuffer.fetchValue(RowsLogBuffer.java:1073)
	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:726)
	at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parseRowsEvent(LogEventConvert.java:549)
	at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$DmlParserStage.onEvent(MysqlMultiStageCoprocessor.java:330)
	at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$DmlParserStage.onEvent(MysqlMultiStageCoprocessor.java:316)
	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)
2021-07-14 09:57:31.326 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConne
ction to /localhost:3306...
2021-07-14 09:57:31.326 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConne
ction to /localhost:3306...
2021-07-14 09:57:31.365 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnecti
on to /localhost:3306...
2021-07-14 09:57:31.404 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initializat
ion packet received, prepare the client authentication packet to send
2021-07-14 09:57:31.404 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication
 packet is sent out.
2021-07-14 09:57:31.440 [pool-4-thread-2] INFO  c.a.otter.canal.server.embedded.CanalServerWithEmbedded - ack successfully, clientId:1001 batchId:2 position:PositionRange[start=LogPosition[id
entity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=13685,serverId=1,gtid=,timestamp=1626066777000]],ack=
LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=70920,serverId=1,gtid=,timestamp=162606
8949000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=70920,serverId=1,gtid=,ti
mestamp=1626068949000]],endSeq=95]
2021-07-14 09:57:31.443 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - auth switch response 
packet is sent out.
2021-07-14 09:57:31.521 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO  c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - KILL DUMP 358092 fail
ure
java.io.IOException: ErrorPacket [errorNumber=1094, fieldCount=-1, message=Unknown thread id: 358092, sqlState=HY000, sqlStateMarker=#]
 with command: KILL CONNECTION 358092
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlUpdateExecutor.update(MysqlUpdateExecutor.java:49)
	at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.disconnect(MysqlConnector.java:113)
	at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.disconnect(MysqlConnection.java:97)
	at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:315)
	at java.lang.Thread.run(Thread.java:748)

分析:mysql系统表权限较高,canal读该表的binlog失败,位点无法移动

解决:将配置项中黑名单加上mysql下的所有表:canal.instance.filter.black.regex = mysql\\..* ,修改后canal集群不需要重启即可恢复;

参考:https://www.cnblogs.com/softidea/p/12894008.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值