-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Caused by: com.github.shyiko.mysql.binlog.event.deserialization.MissingTableMapEventException and lost data #2217
Comments
please aasign this issus to me @leonardBang |
1.我们可以从下面这部分代码看出问题,当出现MissingTableMapEventException这种报错的时候,程序不会抛出异常,而是继续执行,导致过程中Write_rows类型的数据被丢弃,最终导致数据丢失 2.由于binlogclient的代码是zendesk的代码,我们无法修改,所以只能通过lifecycleListener的方式,在上层来处理,我继续看代码,找到应用层监听器的实现,在MySqlStreamingChangeEventSource类里面 3.然后我们看ErrorHandler的实现,可以看到会把报错信息发送给queue |
Assigned to you @dylenWu, please keep going, looking forward your analysis. |
I think we should add this logic to this method to let the client stop receiving messages, so that the queue poll() method can throw an exception |
@dylenWu The option to just ignore the exception is useful. I encountered a weird case where consuming from a later offset will throw the exception that the binlog file does not exist. I tried to manually specify a earlier offset, and the error showed up. In my case I'm relying on the upsert semanitcs of sink operators so having some data duplication is tolerable. |
We cannot ignore the exception, otherwise it will cause data loss |
@dylenWu |
在消费write_rows类型的binlog数据的时候,一定要先消费table_map类型的binlog获取表相关的信息,不然无法解析write_rows类型的binlog。但是当BinlogClient因为心跳超时重新连接的时候,它消费的位点可能在事务的中间,导致没有先消费table_map类型的数据,而是直接消费了write_rows类型的数据。详情请看我上面截的图。 |
2.4.1也出现了这个问题 2.4.2有计划修复吗 |
感谢讲解。我想把生产环境2.1版本的cdc升级到2.4,但是因为兼容性问题 #1795 (comment) 只能新起一个2.4版本cdc的job,不从旧job的checkpoint恢复、而是从旧job最后消费的binlog位点启动。但问题在于,这个位点通常都是write_rows类型,没有schema数据。那么【从指定的binlog位点启动】这个功能应该怎么使用呢,自己去binlog里面找非write_rows类型的最后一条记录?那么问题又来了,如果我的源库有100+张表,如何确保我选择的位点每张表都有schema呢 |
Considering collaboration with developers around the world, please re-create your issue in English on Apache Jira under project |
…d for fake Rotates Event (#3065)
…TableId for fake Rotates Event (apache#3065)
…TableId for fake Rotates Event (apache#3065)
Search before asking
Flink version
1.14.6
Flink CDC version
2.3
Database and its version
mysql
Minimal reproduce step
Caused by: com.github.shyiko.mysql.binlog.event.deserialization.MissingTableMapEventException: No TableMapEventData has been found for table id:15987. Usually that means that you have started reading binary log 'within the logical event group' (e.g. from WRITE_ROWS and not proceeding TABLE_MAP
What did you expect to see?
flink job can start from checkpoint
What did you see instead?
no restart and loss data
Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: