- I have searched the issues of this repository and believe that this is not a duplicate.
- I have checked the FAQ of this repository and believe that this is not a duplicate.
environment
- canal version 1.1.5-SNAPSHOT
- mysql version 8.0.22
- ES version 7.9.2
Issue Description
环境配置:
Mysql同步数据到ES当中,根据官方文档,配置pk,没有配置_id,当mysql删除一条语句的时候,es没有对应的删除这条数据,
看了下es当中,只是把除了pk配置的字段以外的字段的值设置为null
Steps to reproduce
1.配置一个xxx.yml的pk为主键字段,不配置_id
2.启动canal canal-adapter
3.删除mysql的一条数据
Expected behaviour
ES当中的这条数据也被删除
Actual behaviour
但是ES的这条数据并没有被删除,只是除了pk指定的主键字段之外的所有字段的值被设置为null
If there is an exception, please attach the exception trace:
Just put your stack trace here!
1条答案
按热度按时间xghobddn1#
跟踪了一下代码,发现,是代码有点问题:
我试验了下,只需要修改Es7xUpdateRequest为Es7xDeleteRequest就可以了!修改如下:
查看了下ES6也存在这个问题,一样修改就行了,对于配置_id的没有任何问题