dtle
dtle copied to clipboard
the margin of full and incremental replication
Is your feature request related to a problem? Please describe. No
Describe the solution you'd like Need a solution to handle margin of full and incremental replication
Describe alternatives you've considered None
Phase 1
commit: "Keep polling until get a consistent TX with GTID":
- Get GTID (G1)
- start transaction with consistent snapshot
- Get GTID (G2)
- continue if G1 = G2,otherwise retry
Phase 2
remove start transaction with consistent snapshot
It's conflict with homogeneous replication, so ignored.
Phase 3
full-replication and incremental-replication start at the same time
5865a97a before:全量在snapshot TX中提取所有表的数据 after:全量在snapshot TX中提取无PK表的数据,随后commit,在TX外提取其余表的数据
2a2cb5da:将所有update分为delete+insert执行
问题:
update->delete+insert, 导致FK on delete cascade
被误执行。
- dtle现有机制: 支持同步外键, 支持外键级联更新.
- 某DTS机制: “在全量同步和增量同步过程中,DTS会以Session级别暂时禁用约束检查以及外键级联操作。 若任务运行时源库存在级联更新、删除操作,可能会导致数据不一致。”
问题: 是否将dtle变更为和某DTS一样的机制?
FK级联同步与将要进行的变更有冲突, 原因如下.
下列机制
- A 全量不在consistent snapshot中执行
- B update分为delete+insert
- C 全量断点续传(待实现)
- D 已有job增加表, 对新增表进行全量(待实现)
其中
- A依赖B (否则引起数据不一致 gh-ost#519)
- C依赖A
- D依赖A
- B在有FK delete cascade时, 引起问题(FK子表的级联update变为delete)