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

ha(dm): support store task config in Etcd #3620

Merged
merged 21 commits into from
Dec 14, 2021
Merged

ha(dm): support store task config in Etcd #3620

merged 21 commits into from
Dec 14, 2021

Conversation

Ehco1996
Copy link
Contributor

What problem does this PR solve?

subtask of https://github.com/pingcap/ticdc/issues/3583

What is changed and how it works?

use a new key TaskConfigTemplateKeyAdapter to store openapi.Task in etcd

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has persistent data change

Side effects

Related changes

  • Need to update the documentation

Release note

 `support store task config template in Etcd`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 25, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lance6716
  • okJiang

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 25, 2021
@Ehco1996 Ehco1996 mentioned this pull request Nov 25, 2021
14 tasks
@Ehco1996 Ehco1996 added the area/dm Issues or PRs related to DM. label Nov 25, 2021
@Ehco1996 Ehco1996 marked this pull request as ready for review November 25, 2021 08:54
@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 25, 2021
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

@Ehco1996 Ehco1996 added the status/ptal Could you please take a look? label Nov 29, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2021

Codecov Report

Merging #3620 (91ec3cb) into master (eed6f9b) will increase coverage by 0.4309%.
The diff coverage is 71.5545%.

Flag Coverage Δ
cdc 59.3728% <79.4793%> (+0.9356%) ⬆️
dm 56.3367% <51.1811%> (-0.0386%) ⬇️

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

@@               Coverage Diff                @@
##             master      #3620        +/-   ##
================================================
+ Coverage   57.3452%   57.7761%   +0.4309%     
================================================
  Files           460        467         +7     
  Lines         54927      55632       +705     
================================================
+ Hits          31498      32142       +644     
- Misses        20180      20193        +13     
- Partials       3249       3297        +48     

@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 Nov 29, 2021
@lance6716
Copy link
Contributor

could you explain what's a task config template? for example it's constant for each version or is uploaded by web tier?

@Ehco1996
Copy link
Contributor Author

could you explain what's a task config template? for example it's constant for each version or is uploaded by web tier?

add more comments in pingcap/ticdc@c7c86c6 , is this explanation enough?

@lance6716
Copy link
Contributor

could you explain what's a task config template? for example it's constant for each version or is uploaded by web tier?

add more comments in c7c86c6 , is this explanation enough?

I still not understand what's a task config template. your comment doesn't answer "it's constant for each version or is uploaded by web tier?"

and it is created/updated/deleted when? the content is related to a specific DM version or user?

@Ehco1996
Copy link
Contributor Author

I still not understand what's a task config template. your comment doesn't answer "it's constant for each version or is uploaded by web tier?"

and it is created/updated/deleted when? the content is related to a specific DM version or user?


These sections don't quite fit into the comments of the code, so I'll answer you directly here

it's constant for each version or is uploaded by web tier?"

  • it's uploaded from openapi in WebUI

and it is created/updated/deleted when ?

  • the template will be created/updated/deleted when user want to operated task template in dm-cluster , and the openapi of these operations will be added in next pr, see more here

is the content is related to a specific DM version or user?

  • it will not releated to specific DM version or user, becasue there is only one template for each task name, if user upgrade to higher version, WebUI can auto adjust new added/deleted field then save it to etcd.

@lance6716
Copy link
Contributor

I remember it should be renamed to task config instead of task config template, so it's WIP now?

@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Dec 6, 2021

I remember it should be renamed to task config instead of task config template, so it's WIP now?

renamed in pingcap/ticdc@c0131e6 ptal 🧡

@lance6716 lance6716 changed the title ha(dm): support store task config template in Etcd ha(dm): support store task config in Etcd Dec 7, 2021
@@ -897,6 +899,8 @@ var (
"config '%s' regex pattern '%s' invalid, reason: %s", "Please check if params is correctly in the configuration file.")
ErrConfigOnlineDDLMistakeRegex = New(codeConfigOnlineDDLMistakeRegex, ClassConfig, ScopeInternal, LevelHigh,
"online ddl sql '%s' invalid, table %s fail to match '%s' online ddl regex", "Please update your `shadow-table-rules` or `trash-table-rules` in the configuration file.")
ErrOpenAPITaskConfigExists = New(codeConfigOpenAPITaskConfigExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' already exists", "If you want to override it, pleaset use the overwite flag.")
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
ErrOpenAPITaskConfigExists = New(codeConfigOpenAPITaskConfigExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' already exists", "If you want to override it, pleaset use the overwite flag.")
ErrOpenAPITaskConfigExists = New(codeConfigOpenAPITaskConfigExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' already exists", "If you want to override it, pleaset use the overwite flag.")

and check typo

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ehco1996 pleaset -> please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this sentences is genereaed by github copilot and my ide plugin does not check for syntax errors 😂

@@ -897,6 +899,8 @@ var (
"config '%s' regex pattern '%s' invalid, reason: %s", "Please check if params is correctly in the configuration file.")
ErrConfigOnlineDDLMistakeRegex = New(codeConfigOnlineDDLMistakeRegex, ClassConfig, ScopeInternal, LevelHigh,
"online ddl sql '%s' invalid, table %s fail to match '%s' online ddl regex", "Please update your `shadow-table-rules` or `trash-table-rules` in the configuration file.")
ErrOpenAPITaskConfigExists = New(codeConfigOpenAPITaskConfigExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' already exists", "If you want to override it, pleaset use the overwite flag.")
ErrOpenAPITaskConfigNotExists = New(codeConfigOpenAPITaskConfigNotExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' not exists", "")
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
ErrOpenAPITaskConfigNotExists = New(codeConfigOpenAPITaskConfigNotExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' not exists", "")
ErrOpenAPITaskConfigNotExists = New(codeConfigOpenAPITaskConfigNotExists, ClassConfig, ScopeInternal, LevelLow, "the openapi task config for '%s' does not exist", "")

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ehco1996 exists -> exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 9, 2021
@Ehco1996
Copy link
Contributor Author

Ehco1996 commented Dec 9, 2021

could you please take another look for this pr ? thanks 🧡🧡🧡
/cc @GMHDBJD

@ti-chi-bot ti-chi-bot requested a review from GMHDBJD December 9, 2021 03:41
@Ehco1996
Copy link
Contributor Author

could you please take another look for this pr ? thanks 🧡🧡🧡

/cc @okJiang

@ti-chi-bot ti-chi-bot requested a review from okJiang December 10, 2021 08:09
Copy link
Member

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

@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 13, 2021
@Ehco1996
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: f9a4026

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

/run-integration-test

@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-all-tests

@ti-chi-bot ti-chi-bot merged commit 4d699cc into pingcap:master Dec 14, 2021
@Ehco1996 Ehco1996 deleted the openapi-config-template 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/L Denotes a PR that changes 100-499 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.

7 participants