当前位置:网站首页>tidb-cdc日志tables are not eligible to replicate
tidb-cdc日志tables are not eligible to replicate
2022-06-11 17:19:00 【与数据交流的路上】
一、背景
新建了一个cdc同步的任务,上游为tidb,下游为mysql,但是发现一些新建的表并不能同步到下游mysql中
二、排查
1.查看日志
# 内容如下这表明这个表不满足同步条件
tables are not eligible to replicate
2.cdc同步的限制
TiCDC 只能同步至少存在一个有效索引的表,有效索引的定义如下:
- 主键 (PRIMARY KEY) 为有效索引。
- 同时满足下列条件的唯一索引 (UNIQUE INDEX) 为有效索引:
- 索引中每一列在表结构中明确定义非空 (NOT NULL)。
- 索引中不存在虚拟生成列 (VIRTUAL GENERATED COLUMNS)。
三、解决办法
方案一、创建满足cdc同步条件的表
方案二、更改cdc为可以同步无有效索引的表
1.停止任务
tiup ctl:v4.0.15 cdc changefeed pause --pd=http://pd_ip:pd_port --changefeed-id=simple-replication-task
2.修改cdc任务配置文件
vim cdc.yaml
# 添加如下配置
enable-old-value = true
force-replicate = true
3.修改配置
tiup ctl:v4.0.15 cdc changefeed update --pd=http://pd_ip:pd_port --config=./cdc.yaml --changefeed-id=simple-replication-task
4.启动cdc任务
tiup ctl:v4.0.15 cdc changefeed resume --pd=http://pd_ip:pd_port --changefeed-id=simple-replication-task
5.注意点
enable-old-value v4.0.5开始支持
force-replicate v4.0.8开始支持
对于没有有效索引的表,INSERT 和 REPLACE 等操作不具备可重入性,因此会有数据冗余的风险。TiCDC 在同步过程中只保证数据至少分发一次,
因此开启该特性同步没有有效索引的表,一定会导致数据冗余出现。如果不能接受数据冗余,建议增加有效索引,譬如增加具有 AUTO RANDOM 属性的主键列。
官网文档:文档地址
边栏推荐
- Semaphore PV operation of process interaction and its code implementation
- ffmpeg硬编解码 Inter QSV
- RecyclerView缓存复用解析,源码解读
- Connection and difference of network streaming media protocol (RTP RTCP RTMP HLS)
- JPA failed to save multiple entities circularly
- GUI guess number game, directly open play
- Create database instance
- Qlineedit set input mask
- 6-2 写文章(*)
- A journey of database full SQL analysis and audit system performance optimization
猜你喜欢

Custom or subscription? What is the future development trend of China's SaaS industry?

从制造到“智造”,探索制造企业破局之道

Leetcode force deduction question

DFS and BFS notes (I) breadth first search based on C language

Authing biweekly news: authing forum launched (4.25-5.8)

Qlineedit set input mask

05_特征工程—降维

Dynamic: capturing network dynamics using dynamic graph representation learning

【Mysql】redo log,undo log 和binlog详解(四)

Recyclerview cache reuse analysis, source code interpretation
随机推荐
Talk about the interview questions of the collection
CS0006 C# 未能找到元数据文件“C:\Users\...问题
Global and China Mobile Network Optimization (MnO) industry development panoramic survey and Investment Strategy Research Report 2022-2028
如何成为一个乐观派组织?
说说集合的面试题
信息安全数学基础 Chapter 4——二次剩余与方根
Authing 双周动态:应用市场上线(5 .10 —5 .22 )
Learning C language from scratch day 039
04_特征工程—特征选择
导出数据提示--secure-file-priv选项问题的解决方法
Authoring share | understanding saml2 protocol
leetcode--数组
Chip mass production, oppo entering a new era?
Hands on deep learning - multiple input and output channels in the convolution layer
Guide to Dama data management knowledge system: percentage of chapter scores
Connection and difference of network streaming media protocol (RTP RTCP RTMP HLS)
Go get downloaded package path
6-5 统计单词数量(文件)(*)
拜登下令强制推行零信任架构
6-1 从文件读取字符串(*)