Flink cdc + OceanBase Binlog binlog日志获取报错

【 使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】oceanbase-all-in-one-4.2.1_BP9_HF1,obbinlog-ce-4.0.1-1.el7.x86_64
【问题描述】使用 OceanBase Binlog 获取oceanbase 的binlog日志,用flink cdc解析binlog,获取历史数据没问题,读binlog的时候报错
flink cdc脚本:
PRIMARY KEY(ORDER_ID) NOT ENFORCED
) WITH (
‘connector’ = ‘mysql-cdc’,
‘hostname’ = ‘10.26.45.187’,
‘port’ = ‘2883’,
‘username’ = ‘root@ubmp’,
‘password’ = ‘Yfgs!QC/pr{5T6c%s+VdAoF,’,
‘database-name’ = ‘ubmpdb’,
‘table-name’ = ‘od_order_info’
);

7bd10cd4bb20_cbc357ccb763df2852fee8c4fc7d55f2_0_2) switched from RUNNING to FAILED on localhost:47683-137b88 @ k8s01-dev.com (dataPort=52961).
java.lang.RuntimeException: One or more fetchers have encountered exception
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcherManager.checkErrors(SplitFetcherManager.java:263) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.SourceReaderBase.getNextFetch(SourceReaderBase.java:185) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:147) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.api.operators.SourceOperator.emitNext(SourceOperator.java:419) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.io.StreamTaskSourceInput.emitNext(StreamTaskSourceInput.java:68) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:562) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:231) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:858) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:807) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:932) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746) ~[flink-dist-1.18.1.jar:1.18.1]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:562) ~[flink-dist-1.18.1.jar:1.18.1]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_202]
Caused by: java.lang.RuntimeException: SplitFetcher thread 0 received unexpected exception while polling the records
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:168) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.run(SplitFetcher.java:117) ~[flink-connector-files-1.18.1.jar:1.18.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_202]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_202]
… 1 more
Caused by: io.debezium.DebeziumException: Unexpected error while connecting to MySQL and looking at GTID mode:
at io.debezium.connector.mysql.MySqlConnection.subtractGtidSet(MySqlConnection.java:311) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.checkGtidSet(StatefulTaskContext.java:255) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.isBinlogAvailable(StatefulTaskContext.java:213) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.loadStartingOffsetState(StatefulTaskContext.java:200) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.task.context.StatefulTaskContext.configure(StatefulTaskContext.java:127) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.reader.BinlogSplitReader.submitSplit(BinlogSplitReader.java:107) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.debezium.reader.BinlogSplitReader.submitSplit(BinlogSplitReader.java:75) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.source.reader.MySqlSplitReader.pollSplitRecords(MySqlSplitReader.java:116) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at com.ververica.cdc.connectors.mysql.source.reader.MySqlSplitReader.fetch(MySqlSplitReader.java:87) ~[flink-sql-connector-mysql-cdc-3.0.1.jar:3.0.1]
at org.apache.flink.connector.base.source.reader.fetcher.FetchTask.run(FetchTask.java:58) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:165) ~[flink-connector-files-1.18.1.jar:1.18.1]
at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.run(SplitFetcher.java:117) ~[flink-connector-files-1.18.1.jar:1.18.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_202]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_202]
… 1 more
Caused by: java.sql.SQLSyntaxErrorException: FUNCTION GTID_SUBTRACT does not exist

obbinlog 的配置文件发一下吧 。

CREATE BINLOG FOR TENANT myoceanbase.ubmp
TO USER root PASSWORD Fo#zwhfbfP9m%.v}AF&E3Ugs(}
WITH CLUSTER URL http://10.26.45.187:8080/services?Action=ObRootServiceInfo&ObCluster=myoceanbase
, REPLICATE NUM 2;

ob4.2.4支持该语法 功能不生效

在哪里下载4.2.4,可以直接升级吗

直接在 sql 里执行试试呢?

SELECT GTID_SUBTRACT('4849646f-4dc7-11ed-85a9-7cd30abc99b4:1-20', '4849646f-4dc7-11ed-85a9-7cd30abc99b4:1-9');

obclient [(none)]> SELECT GTID_SUBTRACT(‘4849646f-4dc7-11ed-85a9-7cd30abc99b4:1-20’, ‘4849646f-4dc7-11ed-85a9-7cd30abc99b4:1-9’);
ERROR 1305 (42000): FUNCTION GTID_SUBTRACT does not exist

用的 obproxy 是哪个版本?历史版本存在缺陷,把 obproxy 升级到最新的 4.3.2 应该可以解决

我前天下载的,应该是最新的

还真不是4.3.2,上周上的all in是OBProxy 4.3.1版本

这个不开gtid 能否避开这个函数呢 ?? 基于位置点的binlog日志

我可以通过obd 直接升级obproxy 吗


https://www.oceanbase.com/docs/community-oblogproxy-doc-1000000001493744
image

这个您测试了没 ??

这个没有,我已经升级了但是日志突然停止采集了
convert_running=No

SHOW BINLOG status FOR TENANT OBCP.OBCP\G

返回空,没信息

看下 binlog 实例的运行目录有没有 ERROR 或者 EDIAG 记录。

有的,我又开了一个帖子。。。。
详细日志.txt (58.7 KB)

OK 后续讨论转到 Binlog服务运行一段时间就没有继续采集日志了

尽量在一个帖子内讨论 因为是同一个问题 要不然不好跟踪