alibaba / alibaba/otter

同步关闭,某些情况下资源没有释放,导致重启同步时报错Received error packet: errno = 1236, sqlstate = HY000 errmsg = A

Open
#262 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
8.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Mysql版本:5.6.34
Otter版本:4.2.14。开启监控但是没有开启心跳

运行一段时间后出现异常:
![image](https://cloud.githubusercontent.com/assets/8588662/22097845/35c1c67c-de5e-11e6-852d-20a1fa88cb21.png)
怀疑是使用相同的SlaveId去请求Mysql Dump了。从Java的dump文件看会出现同一个同步有两个正在运行的MysqlEventParser。
![image](https://cloud.githubusercontent.com/assets/8588662/22098009/02a7fc9c-de5f-11e6-9834-697b4837fba6.png)
截图中的#1和#3这两个实例的running都是=true,并且#3已经没有被
![image](https://cloud.githubusercontent.com/assets/8588662/22097967/d8e4840c-de5e-11e6-8dda-e52b83ce1c69.png)
引用了,并且AbstractCanalInstance中的其他一些对象,比如CanalEventSink、CanalMetaManager也有这种情况,不知道是不是某些情况没有调用stop方法。

另外Canal在没有开启心跳的情况下,MysqlEventParser的stopHeartBeat方法会报类型转换错误。需要加一个判断条件:
![image](https://cloud.githubusercontent.com/assets/8588662/22098159/c726e6e6-de5f-11e6-9bde-46b05bd083f8.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing shutdown and restart handling around MysqlEventParser and AbstractCanalInstance, focusing on the running instances and referenced CanalEventSink and CanalMetaManager objects shown in the dump. Check the MysqlEventParser.stopHeartBeat path when heartbeat is disabled. Done means shutdown releases the old parser and related objects, restart does not reuse conflicting state, and stopHeartBeat avoids the reported type-conversion error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, mysql
Domain
databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.