Comments (3)
源端和目标端为同一MySQL实例时有该问题。
snapshot事务从长期来看是可以去除的。但尚需考虑各种情况。
from dtle.
MySQL 8.0.32 为复现该问题, 可能是8.0允许 snapshot存在是执行此类DDL.
Case 2 但触发如下逻辑导致增量不复制
[DEBUG] client.driver_mgr.dtle: skipping a binlogEntry with the same sid as target.: driver=dtle @module=dtle.applier job=a1 sid=00003307-1111-1111-1111-111111111111 timestamp="2023-06-09T18:30:38.958+0800"
简单移除sid检测机制会导致无限循环.
if txSid == a.MySQLServerUuid {
a.logger.Debug("skipping a binlogEntry with the same sid as target.", "sid", txSid)
skipEntry = true // *HERE*
} else if a.fwdExtractor != nil {
现状
- 凡是源MySQL的TX, 即时不在复制范围, 也会在目标端形成一个空TX
- 当TX sid和目标端为同一sid时, 跳过TX
- 如果源端和目标端是同一MySQL, 若不进行上述跳过, 则会形成循环复制
方案1
- 当TX sid和目标端为同一sid, 且含有dtle.gtid_executed事务/或DDL dtle tag时, 才跳过TX
问题
- 会形成gtid断点
gtid断点方案: 填补in-memory gtid断点, 上传consul (非实时更新)
- 任务重启时, 从consul gtid继续
- 之前被跳过的gtid, 再次跳过
from dtle.
任务初始建表会造成循环复制. 方案
- 先建表, 等目标端建表完成后, 再获取gtid
- 需要机制: dest task建表完成后通知src task
- by consul, 或
- by nats
- 考虑使用consul kv/全量进度来表示建表完成 #365
from dtle.
Related Issues (20)
- big tx stuck at `cleanGtidExecuted -> WaitForAllCommitted`
- 新增监控指标:当 dtle 与数据库的连接状态
- 提供运维接口,将指定gtid的以原本的形式从远端传输到目标端直接执行
- kafka输出中关于 datetime timestamp 和时区的问题 HOT 1
- dtle panic when src config does not match `DestType`
- MySQL-MySQL: src MySQL @@lctn=1 and dest MySQL @@lctn=0, `ALTER TABLE RENAME` did not match expectations
- retry TX on a deadlock HOT 3
- api: ListColumns bad order
- handle low wait_timeout. HOT 2
- ColumnMap vs reversed job HOT 4
- schema.table renaming vs reversed job
- refactor ApplyEventQueries
- Stuck in MtsManager.WaitForAllCommitted
- Remaining `nomad logmon` process HOT 1
- 0 appears in gtid
- mysql to mysql最新数据未同步 HOT 7
- 调整job配置文件后(新增表同步),如何加载,同时之前的配置不受影响 HOT 1
- handle query_event COMMIT HOT 2
- [ERROR] read dir failed: dataDir=/data/dtle/var/lib/nomad
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dtle.