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

validator(dm): full mode validator, part 1 #4539

Merged
merged 50 commits into from
Mar 3, 2022

Conversation

buchuitoudegou
Copy link
Contributor

@buchuitoudegou buchuitoudegou commented Feb 9, 2022

What problem does this PR solve?

Issue Number: ref #4488

part 1 of #4488

What is changed and how it works?

  1. refactor the prototype of the validator
  2. migrate the validator to DM

Check List

Tests

  • Unit test

Code changes

  • data_validation.go
  • validation_cond.go

Side effects

  • no

Related changes

Release note

`None`

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 9, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Ehco1996
  • lance6716

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 9, 2022
@buchuitoudegou buchuitoudegou changed the title WIP: implementation of incremental validator WIP: validator(dm): implementation of incremental validator Feb 9, 2022
@buchuitoudegou buchuitoudegou added the area/dm Issues or PRs related to DM. label Feb 9, 2022
@ti-chi-bot ti-chi-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 14, 2022
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 17, 2022
@D3Hunter D3Hunter changed the title WIP: validator(dm): implementation of incremental validator WIP: validator(dm): implementation of full mode validator Feb 23, 2022
Copy link
Contributor

@Ehco1996 Ehco1996 left a comment

Choose a reason for hiding this comment

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

rest LGTM

dm/syncer/data_validator.go Show resolved Hide resolved
dm/syncer/data_validator.go Show resolved Hide resolved
dm/syncer/data_validator.go Show resolved Hide resolved
@D3Hunter
Copy link
Contributor

D3Hunter commented Mar 3, 2022

/run-all-tests

@D3Hunter
Copy link
Contributor

D3Hunter commented Mar 3, 2022

/run-dm-integration-test

@D3Hunter
Copy link
Contributor

D3Hunter commented Mar 3, 2022

/run-all-tests

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

rest lgtm

}

targetTable := v.syncer.route(sourceTable)
tableInfo, err := v.syncer.schemaTracker.GetTableInfo(sourceTable)
Copy link
Contributor

@lance6716 lance6716 Mar 3, 2022

Choose a reason for hiding this comment

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

I'm OK with left a TODO.

Another problem is I'm not sure GetTableInfo will race when the TableInfo is changing because syncer is processing a DDL.

@D3Hunter
Copy link
Contributor

D3Hunter commented Mar 3, 2022

/run-all-tests

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 3, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 3, 2022
@Ehco1996
Copy link
Contributor

Ehco1996 commented Mar 3, 2022

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 9533c4d

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 3, 2022
@ti-chi-bot
Copy link
Member

@buchuitoudegou: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@D3Hunter
Copy link
Contributor

D3Hunter commented Mar 3, 2022

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit f113d36 into pingcap:master Mar 3, 2022
@D3Hunter D3Hunter deleted the incr-validator branch March 3, 2022 11:50
"strings"
)

type Cond struct {
Copy link
Member

@okJiang okJiang Mar 29, 2022

Choose a reason for hiding this comment

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

I'm sorry that I can't understand this naming😂.

Can you tell me what does Cond mean? And what is its full name? @D3Hunter

Copy link
Contributor

Choose a reason for hiding this comment

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

condition

Copy link
Member

@okJiang okJiang Mar 29, 2022

Choose a reason for hiding this comment

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

I see that Cond is used in validateDeletedRows and validateInsertAndUpdateRows.

So, why name it condition? I just don't know how to establish their connection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

struct Cond is used to formulate the where clause when querying the downstream database.

Copy link
Member

Choose a reason for hiding this comment

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

I see! It means the condition in SQL...

I didn't think of it first. 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

the name is copied from sync-diff, may need a better name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants