-
Notifications
You must be signed in to change notification settings - Fork 288
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): make start-task/resume-task/check-task
return pre-check result only warning
#4118
checker(dm): make start-task/resume-task/check-task
return pre-check result only warning
#4118
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ | ||
"start-task $cur/conf/only_warning.yaml" \ | ||
"\"state\": \"warn\"" 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this format? @lance6716
{
"result": true,
"msg": "fail to check synchronization configuration with type: no errors but some warnings
detail: {
"results": [
{
"id": 7,
"name": "table structure compatibility check",
"desc": "check compatibility of table structure",
"state": "warn",
"errors": [
{
"severity": "warn",
"short_error": "table `dmctl`.`only_warning` Foreign Key only_warning_ibfk_1 is parsed but ignored by TiDB.",
"instruction": "please ref document: https://docs.pingcap.com/tidb/stable/mysql-compatibility#unsupported-features"
}
],
"extra": "address of db instance - 127.0.0.1:3306"
}
],
"summary": {
"passed": true,
"total": 8,
"successful": 7,
"failed": 0,
"warning": 1
}
}",
"sources": [
{
"result": true,
"msg": "",
"source": "mysql-replica-01",
"worker": "worker1"
}
]
}
/run-dm-integration-test |
/run-dm-integration-test |
/run-dm-integration-test |
/run-dm-integration-test |
1 similar comment
/run-dm-integration-test |
@@ -81,6 +81,9 @@ linters: | |||
# - maligned | |||
|
|||
linters-settings: | |||
dupl: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see details, golangci/golangci-lint#1372
/run-all-tests |
/run-dm-integration-test |
/run-all-tests |
this pr is ready to review. /cc @lance6716 @Ehco1996 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm (I'm checking output of dmctl
)
} | ||
defer c.Close() | ||
|
||
pr := make(chan pb.ProcessResult, 1) | ||
c.Process(ctx, pr) | ||
for len(pr) > 0 { | ||
if len(pr) > 0 { | ||
r := <-pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we always assume there is one result in pr
, as stated in
Lines 44 to 47 in d8dab8d
// Process does the main logic and its returning must send a result to pr channel. | |
// When ctx.Done, stops the process and returns, otherwise the DM-worker will be blocked forever | |
// When not in processing, call Process to continue or resume the process | |
Process(ctx context.Context, pr chan pb.ProcessResult) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be seen that checker
is designed according to the unit at the beginning. But it is not in fact(not complete unit interface). And I think we don't plan to treat him as a unit in the future yet. So it is a semi-finished product. This is the reason that it looks a lot unreasonable.
I think we can modify these unreasonable places after the end of this feature. Result is also. @Ehco1996
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actully it depends on requirements, i am not sure if we have a plan to merge full-time/sync-time sync_diff in to checker? if so i thinks it's better to treat checker as a unit
dm/dm/master/openapi.go
Outdated
@@ -445,7 +445,7 @@ func (s *Server) DMAPIStartTask(c *gin.Context) { | |||
for i := range subTaskConfigList { | |||
subTaskConfigPList[i] = &subTaskConfigList[i] | |||
} | |||
if err = checker.CheckSyncConfigFunc(newCtx, subTaskConfigPList, | |||
if _, err = checker.CheckSyncConfigFunc(newCtx, subTaskConfigPList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so user use openapi to start-task can not see the warnings ?, i thinks we need log theso these warnnings at leaset
/merge |
This pull request has been accepted and is ready to merge. Commit hash: ce09d4c
|
@okJiang: 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. |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #4118 +/- ##
================================================
+ Coverage 55.1722% 55.3781% +0.2059%
================================================
Files 485 495 +10
Lines 59829 61015 +1186
================================================
+ Hits 33009 33789 +780
- Misses 23484 23830 +346
- Partials 3336 3396 +60 |
…k result only warning (pingcap#4118) ref pingcap#3608
What problem does this PR solve?
Issue Number: ref #3608
What is changed and how it works?
Check List
Tests
Related changes
Release note