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}
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/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