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

ddl: args v2 for create/drop/modify schema #55919

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Sep 6, 2024

What problem does this PR solve?

Issue Number: ref #53930

Problem Summary:

What changed and how does it work?

  • args v2 for create-schema/drop-schema/modify schema charset or collate / modify schema placement
  • remove ArgsV2/RawArgsV2, we can reuse Args/RawArgs actually
  • add FinishedJobArgs interface for jobs that need to save some info after job finish
  • add some senity check

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 6, 2024
Copy link

tiprow bot commented Sep 6, 2024

Hi @D3Hunter. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 83.42541% with 30 lines in your changes missing coverage. Please review.

Project coverage is 57.3235%. Comparing base (c9e608a) to head (6874165).
Report is 7 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #55919         +/-   ##
=================================================
- Coverage   72.9281%   57.3235%   -15.6047%     
=================================================
  Files          1605       1755        +150     
  Lines        446061     633534     +187473     
=================================================
+ Hits         325304     363164      +37860     
- Misses       100689     245548     +144859     
- Partials      20068      24822       +4754     
Flag Coverage Δ
integration 40.1485% <79.5580%> (?)
unit 72.5887% <83.4254%> (+0.5350%) ⬆️

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

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 63.1419% <ø> (+17.3606%) ⬆️

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Sep 9, 2024

/retest

Copy link

tiprow bot commented Sep 9, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes-sigs/prow repository.

@joechenrh joechenrh mentioned this pull request Sep 9, 2024
13 tasks
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Sep 9, 2024

/retest

Copy link

tiprow bot commented Sep 9, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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 kubernetes-sigs/prow repository.

change

add assert

change

change

change

modify schema charset/collate

change

change

lint

lint

fix test

change

remove useless code

fix

change

rename

change

change

change

change

change

change
@D3Hunter D3Hunter changed the title [WIP]ddl: args v2 for create/drop/modify schema ddl: args v2 for create/drop/modify schema Sep 9, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 9, 2024
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

if len(job.Args) > 0 {
arg = job.Args[0]
}
job.RawArgs, err = json.Marshal(arg)
Copy link
Contributor

Choose a reason for hiding this comment

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

if can moved inside if len(job.Args) > 0? And do you think we should assert len(job.Args) == 1

Copy link
Contributor Author

@D3Hunter D3Hunter Sep 10, 2024

Choose a reason for hiding this comment

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

no, we need Marshal nil to clear args out

And do you think we should assert len(job.Args) == 1

added in another PR, https://github.com/pingcap/tidb/pull/55964/files#diff-c51ad6b394f865592721a3e18d58574176394570e3efcff7703e8bd0c3c5c2efR518

// FinishedJobArgs is the interface for finished job arguments.
// in most cases, job args are cleared out after the job is finished, but some jobs
// will write some args back to the job for other components.
type FinishedJobArgs interface {
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
type FinishedJobArgs interface {
type finishedJobArgs interface {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

ti-chi-bot bot commented Sep 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, Leavrth

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Sep 10, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-10 03:28:51.432788258 +0000 UTC m=+327001.173212192: ☑️ agreed by lance6716.
  • 2024-09-10 05:21:59.42637602 +0000 UTC m=+333789.166799955: ☑️ agreed by Leavrth.

@ti-chi-bot ti-chi-bot bot merged commit 17c7b90 into pingcap:master Sep 10, 2024
33 checks passed
@D3Hunter D3Hunter deleted the args-c-d-schema branch September 10, 2024 06:21
Benjamin2037 pushed a commit to Benjamin2037/tidb that referenced this pull request Sep 11, 2024
@D3Hunter D3Hunter mentioned this pull request Sep 14, 2024
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants