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

checker(dm): add a worker pool to concurrently working #7796

Merged
merged 12 commits into from
Dec 8, 2022

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Dec 2, 2022

What problem does this PR solve?

Issue Number: ref #4287

What is changed and how it works?

please review dm/pkg/checker/worker_pool.go and dm/pkg/checker/worker_pool_test.go first

remove a TODO: concurrent fetch table seize intra-source

Check List

Tests

  • Unit test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

`None`.

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 2, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • D3Hunter
  • buchuitoudegou

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-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 2, 2022
Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 2, 2022
Signed-off-by: lance6716 <[email protected]>
@lance6716
Copy link
Contributor Author

/run-dm-integration-test

Signed-off-by: lance6716 <[email protected]>
@lance6716
Copy link
Contributor Author

/run-dm-integration-test

Signed-off-by: lance6716 <[email protected]>
@lance6716 lance6716 changed the title [WIP]checker(dm): add a worker pool checker(dm): add a worker pool to concurrently working Dec 3, 2022
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Dec 3, 2022
upstreamParser *parser.Parser
}

func (w *tablesCheckerWorker) handle(ctx context.Context, checkItem *checkItem) ([]*incompatibilityOption, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved from (*TablesChecker).startWorker

@lance6716
Copy link
Contributor Author

/cc @D3Hunter @okJiang @buchuitoudegou

Signed-off-by: lance6716 <[email protected]>
@D3Hunter D3Hunter added the area/dm Issues or PRs related to DM. label Dec 7, 2022
Copy link
Contributor

@D3Hunter D3Hunter 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

}
close(c.optCh)
optWg.Wait()
finalHandler()
Copy link
Contributor

Choose a reason for hiding this comment

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

call it with defer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

though its name is "finalXXX", it is a normal logic rather than some cleanup logic. It will append common message to the result where the message is calculated from all jobs, so if the result has been marked failed we can skip it.

tableMaps map[string]map[filter.Table][]filter.Table,
inCh chan *checkItem,
putJobFn func(*checkItem) bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

why not pass worker-pool directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 8, 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 Dec 8, 2022
@lance6716
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 118ed01

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 8, 2022
@lance6716
Copy link
Contributor Author

/run-all-tests

@lance6716
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot
Copy link
Member

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

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.

@lance6716
Copy link
Contributor Author

/run-all-tests

@lance6716
Copy link
Contributor Author

/run-engine-integration-test

@ti-chi-bot ti-chi-bot merged commit 2f65729 into pingcap:master Dec 8, 2022
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.

4 participants