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 downstream CDC/PiTR check for lightning #7839

Merged
merged 8 commits into from
Dec 16, 2022

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Dec 7, 2022

Signed-off-by: lance6716 lance6716@gmail.com

What problem does this PR solve?

Issue Number: ref #3510

What is changed and how it works?

Also I remove a local disk checking in this PR, because precheck is performed at DM-master and the lightning is run at DM-worker.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
                       {
                               "id": 28,
                               "name": "lightning_downstream_cdc_pitr",
                               "desc": "check whether the downstream has tasks incompatible with Physical import mode",
                               "state": "fail",
                               "errors": [
                                       {
                                               "severity": "fail",
                                               "short_error": "found CDC capture(s): clusterID: default captureID(s): [12e1ad9b-b461-48ba-83d8-9dc4d226001b b5def693-5849-4a54-974a-52fa34869273],\nlocal backend is not compatible with them. Please switch to tidb backend then try again."
                                       }
                               ],
                               "instruction": "you can switch to logical import mode which has no requirements on this"
                       }

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 <lance6716@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 7, 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 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 7, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 added the area/dm Issues or PRs related to DM. label Dec 7, 2022
@lance6716 lance6716 changed the title checker(dm): add downstream CDC/PiTR check for lightning [WIP]checker(dm): add downstream CDC/PiTR check for lightning Dec 7, 2022
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 7, 2022
@lance6716
Copy link
Contributor Author

also check the effects of sorting-dir-physical

Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title [WIP]checker(dm): add downstream CDC/PiTR check for lightning checker(dm): add downstream CDC/PiTR check for lightning Dec 8, 2022
@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 Dec 8, 2022
@lance6716
Copy link
Contributor Author

/cc @GMHDBJD

Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
// NewLightningSortingSpaceChecker creates a new LightningSortingSpaceChecker.
func NewLightningSortingSpaceChecker(lightningChecker restore.PrecheckItem) RealChecker {
return &LightningSortingSpaceChecker{inner: lightningChecker}
// NewLightningCDCPiTRChecker creates a new LightningClusterVersionChecker.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// NewLightningCDCPiTRChecker creates a new LightningClusterVersionChecker.
// NewLightningCDCPiTRChecker creates a new LightningCDCPiTRChecker.

func NewLightningCDCPiTRChecker(lightningChecker restore.PrecheckItem) RealChecker {
c, ok := lightningChecker.(*restore.CDCPITRCheckItem)
if ok {
c.Instruction = "physical import mode is not compatible with them. Please switch to logical import mode then try again."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
c.Instruction = "physical import mode is not compatible with them. Please switch to logical import mode then try again."
c.Instruction = "there are running CDC or PiTR, physical import mode is not compatible with them. Please switch to logical import mode then try again."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The detailed message (CDC or PiTR) is printed at lightning checker's side, like

"found PiTR log streaming task(s): [br_name],\n"+
		"found CDC capture(s): clusterID: <nil> captureID(s): [f14cb04d-5ba1-410e-a59b-ccd796920e9d],\n"+
		"local backend is not compatible with them. Please switch to tidb backend then try again."

no need to repeat again

@@ -42,7 +42,7 @@ const (
LightningRegionDistributionChecking = "region_distribution"
LightningDownstreamVersionChecking = "downstream_version"
LightningFreeSpaceChecking = "free_space"
LightningSortingSpaceChecking = "enough_sorting_space"
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

seem duplicate with free_space

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"sorting space" is a property of DM worker, but precheck is done at DM master. I forget this limit

Copy link
Contributor

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

@@ -42,7 +42,7 @@ const (
LightningRegionDistributionChecking = "region_distribution"
LightningDownstreamVersionChecking = "downstream_version"
LightningFreeSpaceChecking = "free_space"
LightningSortingSpaceChecking = "enough_sorting_space"
Copy link
Contributor

Choose a reason for hiding this comment

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

seem duplicate with free_space

dm/pkg/checker/lightning.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 12, 2022
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716
Copy link
Contributor Author

/cc @gozssky @dsdashun
ptal

@lance6716
Copy link
Contributor Author

ptal @D3Hunter

1 similar comment
@lance6716
Copy link
Contributor Author

ptal @D3Hunter

@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 16, 2022
@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 16, 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: 479429c

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

@lance6716: 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

trigger some heavy tests which will not run always when PR updated.

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.

@ti-chi-bot ti-chi-bot merged commit f2424c7 into pingcap:master Dec 16, 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/M Denotes a PR that changes 30-99 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