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

loader(dm): register tls config when clean checkpoint #3522

Merged
merged 31 commits into from
Dec 14, 2021
Merged

loader(dm): register tls config when clean checkpoint #3522

merged 31 commits into from
Dec 14, 2021

Conversation

Ehco1996
Copy link
Contributor

@Ehco1996 Ehco1996 commented Nov 18, 2021

What problem does this PR solve?

What is changed and how it works?

  • set right logger config when init lightning
  • register and deregister TLS config when removing checkpoint

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • None

Side effects

  • Increased code complexity

Related changes

  • None

Release note

Please add a release note.
`None`.

@Ehco1996 Ehco1996 added the area/dm Issues or PRs related to DM. label Nov 18, 2021
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 18, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • glorv
  • 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 18, 2021
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 19, 2021
@Ehco1996 Ehco1996 changed the title dm/lightning: register tls config when clean checkpoint loader(dm): register tls config when clean checkpoint Nov 22, 2021
@Ehco1996 Ehco1996 marked this pull request as ready for review November 22, 2021 01:13
@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 Nov 22, 2021
@Ehco1996
Copy link
Contributor Author

/run-dm-integration-tests

@Ehco1996 Ehco1996 marked this pull request as draft November 22, 2021 03:09
@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 Nov 22, 2021
@Ehco1996
Copy link
Contributor Author

/run-dm-integration-tests

@Ehco1996 Ehco1996 marked this pull request as ready for review November 22, 2021 06:01
@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 Nov 22, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2021

Codecov Report

Merging #3522 (fa145d0) into master (eed6f9b) will increase coverage by 0.4584%.
The diff coverage is 70.1877%.

Flag Coverage Δ
cdc 59.4059% <79.4793%> (+0.9687%) ⬆️
dm 56.3560% <39.6984%> (-0.0193%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@               Coverage Diff                @@
##             master      #3522        +/-   ##
================================================
+ Coverage   57.3452%   57.8036%   +0.4584%     
================================================
  Files           460        465         +5     
  Lines         54927      55538       +611     
================================================
+ Hits          31498      32103       +605     
+ Misses        20180      20150        -30     
- Partials       3249       3285        +36     

if err = cfg.Adjust(ctx); err != nil {
return err
}
err = l.runLightning(ctx, cfg)
if err == nil {
// lightning will auto deregister tls when task done, so we need to register it again for removing checkpoint
Copy link
Contributor

Choose a reason for hiding this comment

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

we might let lightning not deregister the certificate. If there're more than one subtasks, the certificate may still be deregister between line 245 and line 249

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now lightning allow register tls config with different name, and it test is passed, ptal 🧡

Copy link
Contributor

Choose a reason for hiding this comment

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

CheckpointRemove should be postponed to cleanmeta. I will add this logic in a following PR, so LGTM.

@Ehco1996
Copy link
Contributor Author

/hold need change lightning behaviour and upgrade dep

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 23, 2021
lightningCfg.TikvImporter.Backend = cfg.TiDB.Backend
lightningCfg.PostRestore.Checksum = lcfg.OpLevelOff
if cfg.TiDB.Backend == lcfg.BackendLocal {
lightningCfg.TikvImporter.SortedKVDir = cfg.Dir
}
lightningCfg.Mydumper.SourceDir = cfg.Dir
lightningCfg.App.Config.Level = cfg.LogLevel
lightningCfg.App.Config.File = cfg.LogFile
Copy link
Contributor

Choose a reason for hiding this comment

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

We should net let lightning init log another time. pingcap/tidb#29291 this PR will skip init lightning log so lightning will share the global config with dm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed ptal

@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Dec 8, 2021

/run-all-tests

@Ehco1996 Ehco1996 added status/ptal Could you please take a look? and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Dec 8, 2021
@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Dec 8, 2021

/run-all-tests

dm/loader/lightning.go Outdated Show resolved Hide resolved
dm/tests/tls/run.sh Outdated Show resolved Hide resolved
dm/tests/tls/run.sh Outdated Show resolved Hide resolved
@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Dec 9, 2021

/run-dm-integration-tests

@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Dec 9, 2021

/run-dm-integration-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

dm/loader/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 14, 2021
@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 14, 2021
@glorv
Copy link
Contributor

glorv commented Dec 14, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: fa145d0

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

@Ehco1996: 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.

@Ehco1996
Copy link
Contributor Author

/run-integration-test
/run-leak-test

@ti-chi-bot ti-chi-bot merged commit 2057c2b into pingcap:master Dec 14, 2021
@Ehco1996 Ehco1996 deleted the lightning-tls branch December 20, 2021 01:13
zhaoxinyu pushed a commit to zhaoxinyu/ticdc that referenced this pull request Dec 29, 2021
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. status/ptal Could you please take a look?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lightning loader can use TLS from DM cluster wrong logger conifg and data race when enable lightning-loader
5 participants