create table store_bj (id int primary key,name varchar(20));
mysql1:
mysql> insert into store_bj values (12,store_bj_11);
Query OK, 1 row affected (0.01 sec)
mysql2:
mysql> insert into store_bj values (12,store_bj_12);
Query OK, 1 row affected (0.01 sec)
[tidb@tidb1 ~]$ tiup dmctl --master-addr ***.**.***.134:8261 query-status two_tidb_slave
………
"subTaskStatus": [
{
"name": "two_tidb_slave",
"stage": "Paused",
"unit": "Sync",
"result": {
"isCanceled": false,
"errors": [
{
"ErrCode": 100*6,
"ErrClass": "database",
"ErrScope": "not-set",
"ErrLevel": "high",
"Message": "startLocation: [position: (, 0), gtid-set: ], endLocation: [position: (mysql-bin.000002, 12368), gtid-set: ]: execute statement failed: commit",
"RawCause": "Error 1062: Duplicate entry 12 for key PRIMARY",
"Workaround": ""
}
],
"detail": null
…………
[tidb@tidb1 ~]$ cat /home/tidb/dm/deploy/dm-worker-8262/log/dm-worker.log
………
[2021/12/03 16:54:39.773 +08:00] [INFO] [syncer.go:1902] ["meet heartbeat event and then flush jobs"] [task=two_tidb_slave] [unit="binlog replication"]
[2021/12/03 16:54:39.773 +08:00] [INFO] [syncer.go:3016] ["flush all jobs"] [task=two_tidb_slave] [unit="binlog replication"] ["global checkpoint"="position: (mysql-bin.000002, 12123), gtid-set: (flushed position: (mysql-bin.000002, 12123), gtid-set: )"]
[2021/12/03 16:54:39.773 +08:00] [INFO] [syncer.go:1119] ["flushed checkpoint"] [task=two_tidb_slave] [unit="binlog replication"] [checkpoint="position: (mysql-bin.000002, 12123), gtid-set: (flushed position: (mysql-bin.000002, 12123), gtid-set: )"]
[2021/12/03 16:54:39.773 +08:00] [INFO] [syncer.go:1127] ["after last flushing checkpoint, DM has ignored row changes by expression filter"] [task=two_tidb_slave] [unit="binlog replication"] ["number of filtered insert"=0] ["number of filtered update"=0] ["number of filtered delete"=0]
[2021/12/03 16:54:41.794 +08:00] [ERROR] [db.go:201] ["execute statements failed after retry"] [task=two_tidb_slave] [unit="binlog replication"] [queries="[INSERT INTO `store`.`store_bj` (`id`,`name`) VALUES (?,?)]"] [arguments="[[12 store_bj_12]]"] [error="[code=10006:class=database:scope=not-set:level=high], Message: execute statement failed: commit, RawCause: Error 1062: Duplicate entry 12 for key PRIMARY"]
[2021/12/03 16:54:41.794 +08:00] [INFO] [syncer.go:2854] ["print status routine exits"] [task=two_tidb_slave] [unit="binlog replication"] [error="context canceled"]
[2021/12/03 16:54:41.794 +08:00] [INFO] [syncer.go:1696] ["binlog replication main routine quit(context canceled)!"] [task=two_tidb_slave] [unit="binlog replication"] ["last location"="position: (mysql-bin.000002, 12399), gtid-set: "]
[2021/12/03 16:54:41.828 +08:00] [INFO] [syncer.go:1602] ["flush checkpoints when exit task"] [task=two_tidb_slave] [unit="binlog replication"]
[2021/12/03 16:54:41.837 +08:00] [INFO] [checkpoint.go:694] ["rollback checkpoint"] [task=two_tidb_slave] [unit="binlog replication"] [component="remote checkpoint"] [schema=store] [table=store_shenzhen] [from="position: (mysql-bin.000002, 10712), gtid-set: "] [to="position: (mysql-bin.000002, 10712), gtid-set: "]
[2021/12/03 16:54:41.837 +08:00] [WARN] [checkpoint.go:697] ["failed to drop table from schema tracker"] [task=two_tidb_slave] [unit="binlog replication"] [component="remote checkpoint"] [schema=store] [table=store_shenzhen] [error="[schema:1146]Table store.store_shenzhen doesnt exist"]
[2021/12/03 16:54:41.844 +08:00] [WARN] [syncer.go:681] ["something wrong with rollback global checkpoint"] [task=two_tidb_slave] [unit="binlog replication"] ["previous position"="position: (mysql-bin.000002, 12399), gtid-set: "] ["current position"="position: (mysql-bin.000002, 12123), gtid-set: "]
[2021/12/03 16:54:41.844 +08:00] [INFO] [subtask.go:292] ["unit process returned"] [subtask=two_tidb_slave] [unit=Sync] [stage=Paused] [status="{"totalEvents":1,"syncerBinlog":"(mysql-bin.000002, 12123)","binlogType":"remote"}"]
[2021/12/03 16:54:41.844 +08:00] [ERROR] [subtask.go:311] ["unit process error"] [subtask=two_tidb_slave] [unit=Sync] ["error information"="{"ErrCode":10006,"ErrClass":"database","ErrScope":"not-set","ErrLevel":"high","Message":"startLocation: [position: (, 0), gtid-set: ], endLocation: [position: (mysql-bin.000002, 12368), gtid-set: ]: execute statement failed: commit","RawCause":"Error 1062: Duplicate entry 12 for key PRIMARY"}"]
[2021/12/03 16:54:45.961 +08:00] [WARN] [task_checker.go:390] ["task cant auto resume"] [component="task checker"] [task=two_tidb_slave]
…………
[tidb@tidb1 ~]$ tiup dmctl -master-addr ***.**.***.134:8261 stop-task task3637.yaml
[tidb@tidb1 ~]$ tiup dmctl -master-addr ***.**.***.134:8261 start-task task3637.yaml
[tidb@tidb1 ~]$ tiup dmctl --master-addr ***.**.***.134:8261 query-status two_tidb_slave
curl http://{TiDBIP}:1**80/mvcc/key/{db}/{table}/{handle}
select _tidb_rowid from xxx where trade_no=‘190606LI8OODRTZA5XX1’;
curl http://{TiDBIP}:1**80/mvcc/key/{db}/{table}/{_tidb_rowid}
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129629.html
摘要:合库合表数据同步在使用支撑大量数据时,经常会选择使用分库分表的方案。但当将数据同步到后,通常希望逻辑上进行合库合表。为支持合库合表的数据同步,主要实现了以下的一些功能。 作者:张学程 简介 TiDB-DM(Data Migration)是用于将数据从 MySQL/MariaDB 迁移到 TiDB 的工具。该工具既支持以全量备份文件的方式将 MySQL/MariaDB 的数据导入到 Ti...
摘要:作者王相本文为源码阅读系列文章的第七篇,在上篇文章中我们介绍了的实现,主要包括目录结构定义数据的处理流程主从切换支持的读取等逻辑。本篇文章我们将会对的定制化数据同步功能进行详细的讲解。 作者:王相 本文为 DM 源码阅读系列文章的第七篇,在 上篇文章 中我们介绍了 relay log 的实现,主要包括 relay log 目录结构定义、relay log 数据的处理流程、主从切换支持、...
阅读 1346·2023-01-11 13:20
阅读 1684·2023-01-11 13:20
阅读 1132·2023-01-11 13:20
阅读 1858·2023-01-11 13:20
阅读 4100·2023-01-11 13:20
阅读 2704·2023-01-11 13:20
阅读 1385·2023-01-11 13:20
阅读 3597·2023-01-11 13:20