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): make start-task/resume-task/check-task return pre-check result only warning #4118

Merged
merged 15 commits into from
Jan 12, 2022

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Dec 29, 2021

What problem does this PR solve?

Issue Number: ref #3608

What is changed and how it works?

  • as title

Check List

Tests

  • Integration test

Related changes

  • Need to update the documentation

Release note

Please add a release note.
If you don't think this PR needs a release note then fill it with `None`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 29, 2021

[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 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 29, 2021
@okJiang okJiang added the area/dm Issues or PRs related to DM. label Dec 29, 2021
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 4, 2022
Comment on lines +287 to +289
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"start-task $cur/conf/only_warning.yaml" \
"\"state\": \"warn\"" 1
Copy link
Member Author

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"
        }
    ]
}

@okJiang
Copy link
Member Author

okJiang commented Jan 6, 2022

/run-dm-integration-test

@okJiang
Copy link
Member Author

okJiang commented Jan 7, 2022

/run-dm-integration-test
/run-verify

@okJiang
Copy link
Member Author

okJiang commented Jan 7, 2022

/run-dm-integration-test

@okJiang
Copy link
Member Author

okJiang commented Jan 7, 2022

/run-dm-integration-test

1 similar comment
@okJiang
Copy link
Member Author

okJiang commented Jan 7, 2022

/run-dm-integration-test

@@ -81,6 +81,9 @@ linters:
# - maligned

linters-settings:
dupl:
Copy link
Member Author

Choose a reason for hiding this comment

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

@okJiang
Copy link
Member Author

okJiang commented Jan 7, 2022

/run-all-tests

@okJiang
Copy link
Member Author

okJiang commented Jan 7, 2022

/run-dm-integration-test
/run-integration-test
/run-kafka-integration-test

@okJiang
Copy link
Member Author

okJiang commented Jan 10, 2022

/run-all-tests

@okJiang okJiang marked this pull request as ready for review January 10, 2022 02:04
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 10, 2022
@okJiang
Copy link
Member Author

okJiang commented Jan 10, 2022

this pr is ready to review. /cc @lance6716 @Ehco1996

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 (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
Copy link
Contributor

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

// 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)

Copy link
Member Author

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

Copy link
Contributor

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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 11, 2022
@@ -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,
Copy link
Contributor

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

@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 Jan 12, 2022
@Ehco1996
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: ce09d4c

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

@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-commenter
Copy link

Codecov Report

Merging #4118 (a64ef81) into master (08da001) will increase coverage by 0.2059%.
The diff coverage is 48.5294%.

Flag Coverage Δ
cdc 59.2320% <63.1722%> (+0.5872%) ⬆️
dm 52.1387% <35.3086%> (-0.1158%) ⬇️

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     

@ti-chi-bot ti-chi-bot merged commit 750816f into pingcap:master Jan 12, 2022
zhaoxinyu pushed a commit to zhaoxinyu/ticdc that referenced this pull request Jan 20, 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 Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 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.

5 participants