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

Topo to topo compare #4392

Merged
merged 5 commits into from
Dec 16, 2018
Merged

Topo to topo compare #4392

merged 5 commits into from
Dec 16, 2018

Conversation

rafael
Copy link
Member

@rafael rafael commented Nov 26, 2018

Description

The following extends topo2topo tool to add a compare option flag. When this flag is passed, the tool will compare from and to topologies and error if they are not in sync.

This is useful to make sanity checks before doing cutovers when migrating from different topologies.

The approach I took to make this compare is to follow the same steps as copy and perform a DeepEqual between the data structures coming from fromTS and toTS.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@rafael rafael requested a review from sougou as a code owner November 26, 2018 15:12
Copy link
Member

@demmer demmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good -- see comment re parallelism and clean up the comments.

go/cmd/topo2topo/topo2topo.go Outdated Show resolved Hide resolved
go/vt/topo/helpers/compare.go Outdated Show resolved Hide resolved
go/vt/topo/helpers/compare.go Outdated Show resolved Hide resolved
go/vt/topo/helpers/compare.go Outdated Show resolved Hide resolved
go/vt/topo/helpers/compare.go Outdated Show resolved Hide resolved
go/vt/topo/helpers/compare.go Outdated Show resolved Hide resolved
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@rafael
Copy link
Member Author

rafael commented Nov 27, 2018

@demmer - comments have been addressed. Good catch of parallelisms. I refactored copy to also reflect this.

demmer
demmer previously requested changes Nov 27, 2018
Copy link
Member

@demmer demmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compare stuff looks good to me but error handling for the copy needs a bit more work.

go/vt/topo/helpers/copy.go Show resolved Hide resolved
go/vt/topo/helpers/copy.go Outdated Show resolved Hide resolved
go/vt/topo/helpers/copy.go Show resolved Hide resolved
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@sougou sougou dismissed demmer’s stale review December 16, 2018 19:25

comments addressed

@sougou sougou merged commit 8ff9bf0 into vitessio:master Dec 16, 2018
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

Successfully merging this pull request may close these issues.

3 participants