【 TiDB 使用环境】生产环境
【 TiDB 版本】源库是4.0.0,目标库6.5.3
【复现路径】数据同步后比对
【遇到的问题:问题现象及影响】sync-diff报"the isEqual1 and isEqual2 cannot be both true错误
【资源配置】无
【附件:截图/日志/监控】
[2024/01/27 13:48:37.510 +08:00] [INFO] [diff.go:553] [“chunk split successfully”] [“chunk id”=“{"table-index":26,"bucket-index-left":73,"bucket-index-right":73,"chunk-index":2,"chunk-count":4}”] [count1=1277] [count2=1275]
[2024/01/27 13:48:37.512 +08:00] [FATAL] [diff.go:575] [“the isEqual1 and isEqual2 cannot be both true”] [stack=“main.(*Diff).binSearch\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:575\nmain.(*Diff).BinGenerate\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:506\nmain.(*Diff).consume\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:446\nmain.(*Diff).Equal.func2\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:282\ngithub.com/pingcap/tidb-tools/sync_diff_inspector/utils.(*WorkerPool).Apply.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/utils/utils.go:94”]
[tidb@cnsz082764 output-ubisql-tidb-task6]$
配置:
more xxx-tidb-sync-diff-task.toml
Diff Configuration.
######################### Global config #########################
check-thread-count = 4
export-fix-sql = true
check-struct-only = false
######################### Datasource config #########################
[data-sources]
[data-sources.tidb_prd]
host = “xxx”
port = 6080
user = “xx”
password = xxx
snapshot = xxxx
[data-sources.tidb_prd1]
host = “xxxx”
port = 6080
user = xx
password = xxxx
snapshot = “447303592564490243”
######################### Task config #########################
[task]
output-dir = “/full_bak/sync-diff/output-ubisql-tidb-task6”
source-instances = [“tidb_prd”]
target-instance = “tidb_prd1”
target-check-tables = [“xxx.*”]
[table-configs.config1]
target-tables = [“xxx.xxx”]
index-fields = [“ID”]
chunk-size = 50000
命令如下:
nohup ./sync_diff_inspector_v6.5.4 --config ./tidb-sync-diff-task.toml --log-level “debug” > ./task.log &
哈喽沃德
2024 年1 月 27 日 17:03
2
isEqual1和 isEqual2不能同时设置为true
1 个赞
changpeng75
(Ti D Ber Aw K Xsgx O)
2024 年1 月 28 日 07:29
3
dba远航
(Ti D Ber M Lo7 Bqhk)
2024 年1 月 29 日 00:45
4
isEqual1和 isEqual2不能同时设置为true,调整一下
[task]下面配置下target-configs = [“config1”]
changpeng75
(Ti D Ber Aw K Xsgx O)
2024 年1 月 29 日 13:09
11
需要科学上网,里面的解决方案就是“sync-diff需要设置缺省快照。”。
github打不开,可以帮忙粘贴下设置缺省快照的案例吗?谢谢/
zhang_2023
(Ti D Ber V2 Uo I Fmi)
2024 年1 月 30 日 00:59
14
isEqual1和 isEqual2不能同时设置为true
谢谢,请问default snapshot具体是怎么设置?没有找到相关资料。下面这些算吗?
[data-sources.tidb_prd]
host = “xxxx”
port = xxxx
user = “xxxx”
password = “xxxx”
snapshot = “433408135904886975”
[data-sources.ubisql_prd]
host = “xxxx”
port = xxxx
user = “xxxx”
password = “xxxx”
snapshot = “433408135942111294”
changpeng75
(Ti D Ber Aw K Xsgx O)
2024 年1 月 30 日 05:06
16
我们现在是指定了具体值,有报错误。我试试snapshot=‘auto’。
另外isEqual1和isEqual2这两个参数我设置,报不能识别这两个参数。
CDC才能使用snapshot=“auto”
[2024/02/02 09:29:34.799 +08:00] [FATAL] [main.go:120] [“failed to initialize diff process”] [error=“fetching auto-position tidb_snapshot failed: Error 1146 (42S02): Table ‘tidb_cdc.s
yncpoint_v1’ doesn’t exist”] [errorVerbose=“Error 1146 (42S02): Table ‘tidb_cdc.syncpoint_v1’ doesn’t exist\nfetching auto-position tidb_snapshot failed\ngithub.com/pingcap/tidb-tools
/sync_diff_inspector/source.getAutoSnapshotPosition\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/source/source.go:248\ngithub
.com/pingcap/tidb-tools/sync_diff_inspector/source.initDBConn\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/source/source.go:2
63\ngithub.com/pingcap/tidb-tools/sync_diff_inspector/source.NewSources\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/source/s
ource.go:117\nmain.(*Diff).init\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:137\nmain.NewDiff\n\t/home/jenkins/agent
/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:95\nmain.checkSyncState\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingca
p/tidb-tools/sync_diff_inspector/main.go:117\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/main.go:104\nruntime.mai
n\n\t/usr/local/go/src/runtime/proc.go:267\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650”] [stack=“main.checkSyncState\n\t/home/jenkins/agent/workspace/build-common/go
/src/github.com/pingcap/tidb-tools/sync_diff_inspector/main.go:120\nmain.main\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/ma
in.go:104\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:267”]
去掉snaphot参数后,还是会报错
[2024/02/01 21:20:21.266 +08:00] [FATAL] [diff.go:575] [“the isEqual1 and isEqual2 cannot be both true”] [stack=“main.(*Diff).binSearch\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:575\nmain.(*Diff).binSearch\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:562\nmain.(*Diff).BinGenerate\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:506\nmain.(*Diff).consume\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:446\nmain.(*Diff).Equal.func2\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/diff.go:282\ngithub.com/pingcap/tidb-tools/sync_diff_inspector/utils.(*WorkerPool).Apply.func1\n\t/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb-tools/sync_diff_inspector/utils/utils.go:94”]
changpeng75
(Ti D Ber Aw K Xsgx O)
2024 年2 月 4 日 08:18
21
将目标端的snapshot设置成与源端相同可以吗?