Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diff binSearch should not fatal exit when data is equal #626

Open
Howie516 opened this issue Jun 12, 2022 · 1 comment
Open

diff binSearch should not fatal exit when data is equal #626

Howie516 opened this issue Jun 12, 2022 · 1 comment

Comments

@Howie516
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

log:
[2022/06/11 04:00:58.280 +08:00] [FATAL] [diff.go:564] ["the isEqual1 and isEqual2 cannot be both true"] [stack="main.(*Diff).binSearch\n\t/Users/yunzhanghu1151/code/tidb-tools/sync_diff_inspector/diff.go:564\nmain.(*Diff).BinGenerate\n\t/Users/yunzhanghu1151/code/tidb-tools/sync_diff_inspector/diff.go:496\nmain.(*Diff).consume\n\t/Users/yunzhanghu1151/code/tidb-tools/sync_diff_inspector/diff.go:435\nmain.(*Diff).Equal.func2\n\t/Users/yunzhanghu1151/code/tidb-tools/sync_diff_inspector/diff.go:284\ngithub.com/pingcap/tidb-tools/sync_diff_inspector/utils.(*WorkerPool).Apply.func1\n\t/Users/yunzhanghu1151/code/tidb-tools/sync_diff_inspector/utils/utils.go:75"]

version: v5.4.1
diff.go 564 row
// If there is a count zero, we think the range is very small. if (!isEqual1 && !isEqual2) || (count1 == 0 || count2 == 0) { return tableRange, nil } else if !isEqual1 { c, err := df.binSearch(ctx, targetSource, tableRange1, count1, tableDiff, indexColumns) if err != nil { return nil, errors.Trace(err) } return c, nil } else if !isEqual2 { c, err := df.binSearch(ctx, targetSource, tableRange2, count2, tableDiff, indexColumns) if err != nil { return nil, errors.Trace(err) } return c, nil } else { // TODO: handle the error to foreground log.Fatal("the isEqual1 and isEqual2 cannot be both true") return nil, nil }

@Leavrth
Copy link
Contributor

Leavrth commented Jul 20, 2022

the same as #631
syncdiff need to set default snapshot if it is not set in config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants