Skip to content
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

No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT #1128

Closed
czxin788 opened this issue May 24, 2024 · 10 comments · Fixed by #1129
Closed

No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT #1128

czxin788 opened this issue May 24, 2024 · 10 comments · Fixed by #1129

Comments

@czxin788
Copy link

otter这个问题怎么解决,怎么跳过

pid:1 nid:1 exception:setl:com.alibaba.otter.node.etl.select.exceptions.SelectException: java.lang.IllegalArgumentException: No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT
at com.alibaba.otter.node.etl.select.selector.MessageParser.parse(MessageParser.java:218)
at com.alibaba.otter.node.etl.select.selector.canal.CanalEmbedSelector.selector(CanalEmbedSelector.java:279)
at com.alibaba.otter.node.etl.select.SelectTask.processSelect(SelectTask.java:236)
at com.alibaba.otter.node.etl.select.SelectTask.access$300(SelectTask.java:94)
at com.alibaba.otter.node.etl.select.SelectTask$1.run(SelectTask.java:208)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:750)
Caused by: java.lang.IllegalArgumentException: No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT
at java.lang.Enum.valueOf(Enum.java:238)
at com.alibaba.otter.shared.etl.model.EventType.valueOf(EventType.java:24)
at com.alibaba.otter.node.etl.select.selector.MessageParser.internParse(MessageParser.java:339)
at com.alibaba.otter.node.etl.select.selector.MessageParser.parse(MessageParser.java:148)
... 9 more
@czxin788
Copy link
Author

我用master编译成4.2.19版本后,还是不支持xa事务。

@whhe
Copy link
Collaborator

whhe commented May 24, 2024

目前是不支持XA的,你看看 #1129 能不能跳过

@czxin788
Copy link
Author

目前是不支持XA的,你看看 #1129 能不能跳过

好的,我重新编译试一下

@czxin788
Copy link
Author

确实不报错了,但是好像是正常有数据的event也都跳过了
image

最终导致没有一条新增数据写入
image

@czxin788
Copy link
Author

czxin788 commented May 24, 2024

我这么写也不对,反而编译不过去了:

 EventType eventType = EventType.valueOf(rowChange.getEventType().name());

        if (eventType ==  "XACOMMIT" ) {
            logger.warn("Discard unsupported event type: {}", rowChange.getEventType());
            return null;
        }

@whhe
Copy link
Collaborator

whhe commented May 24, 2024

确实不报错了,但是好像是正常有数据的event也都跳过了 image

最终导致没有一条新增数据写入 image

我的错,这里要判断名字。我更新了下,再试试

@czxin788
Copy link
Author

czxin788 commented May 25, 2024

感谢回复,我用了你第二次的代码编译后,还是把所有的event全部跳过了,最终导致一条数据都没有同步过来。
我确认我的binlog position设置是对的,并且position后面有新增数据,因为我可用my2sql工具能解析出具体新增sql。

我用的这个代码编译的:https://github.com/whhe/otter/tree/discard-unsupported-event

@whhe
Copy link
Collaborator

whhe commented May 25, 2024

感谢回复,我用了你第二次的代码编译后,还是把所有的event全部跳过了,最终导致一条数据都没有同步过来。 我确认我的binlog position设置是对的,并且position后面有新增数据,因为我可用my2sql工具能解析出具体新增sql。

我用的这个代码编译的:https://github.com/whhe/otter/tree/discard-unsupported-event

跳过的时候有打印日志吗?Discard unsupported event type 这个

理论上新加的这个过滤只会丢弃 GTID, XACOMMIT, XAROLLBACK, MHEARTBEAT这四种

@czxin788
Copy link
Author

czxin788 commented May 25, 2024

有日志,我应该怎么排错

2024-05-25 12:14:17.810 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:17.816 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:17.816 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:36.160 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:36.160 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:36.160 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:55.164 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:55.164 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:14:55.165 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:15:00.899 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:15:00.899 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT
2024-05-25 12:15:00.899 [pipelineId = 6,taskName = ProcessSelect] WARN  com.alibaba.otter.node.etl.select.selector.MessageParser - Discard unsupported event type: XACOMMIT

@czxin788
Copy link
Author

czxin788 commented May 25, 2024

@whhe
太感谢了,用你的代码可以了。
这次是我的问题,我在配置数据表时配错了,原来配置表时只需要写表名就行了,我给写成库名,表名了。
现在成功跳过xa事务,任务跑起来了。
最后再次感谢你的帮助,周末愉快。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants