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: refactor job args for set/update tiflash-replica and alter-table-placement ddl #56241

Merged
merged 17 commits into from
Sep 26, 2024

Conversation

joccau
Copy link
Member

@joccau joccau commented Sep 23, 2024

What problem does this PR solve?

Issue Number: Ref #53930
Ref #54436

Problem Summary:

What changed and how does it work?

Refactor the job args for follow ddl type:

  • ActionAlterTablePlacement
  • ActionUpdateTiFlashReplicaStatus
  • ActionSetTiFlashReplica

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 23, 2024
@joccau joccau changed the title [wip]ddl: refactor job args for [wip]ddl: refactor job args for AlterTablePlacement Sep 23, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 86.07595% with 11 lines in your changes missing coverage. Please review.

Project coverage is 76.2372%. Comparing base (7c88876) to head (acfb412).
Report is 4 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #56241        +/-   ##
================================================
+ Coverage   73.3294%   76.2372%   +2.9077%     
================================================
  Files          1619       1641        +22     
  Lines        446470     455586      +9116     
================================================
+ Hits         327394     347326     +19932     
+ Misses        99020      86776     -12244     
- Partials      20056      21484      +1428     
Flag Coverage Δ
integration 52.1517% <16.4557%> (?)
unit 72.6033% <86.0759%> (+0.0867%) ⬆️

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

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 63.0988% <ø> (+18.0692%) ⬆️

@ti-chi-bot ti-chi-bot 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. do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked labels Sep 23, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 24, 2024
@joccau joccau changed the title [wip]ddl: refactor job args for AlterTablePlacement [wip]ddl: refactor job args for set-tiflash-replica/update-tiflash-replica and alter-table-placement ddl. Sep 24, 2024
@joccau joccau changed the title [wip]ddl: refactor job args for set-tiflash-replica/update-tiflash-replica and alter-table-placement ddl. ddl: refactor job args for set-tiflash-replica/update-tiflash-replica and alter-table-placement ddl. Sep 24, 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 24, 2024
@joccau
Copy link
Member Author

joccau commented Sep 24, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented Sep 24, 2024

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test fast_test_tiprow_ddl
  • /test tidb_parser_test

Use /test all to run the following jobs that were automatically triggered:

  • fast_test_tiprow
  • tidb_parser_test

In response to this:

/test pull-br-integration-test

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.

pkg/ddl/executor.go Outdated Show resolved Hide resolved
pkg/meta/model/job_args.go Show resolved Hide resolved
pkg/meta/model/job_args.go Outdated Show resolved Hide resolved
pkg/meta/model/job_args.go Outdated Show resolved Hide resolved
@D3Hunter D3Hunter changed the title ddl: refactor job args for set-tiflash-replica/update-tiflash-replica and alter-table-placement ddl. ddl: refactor job args for set/update tiflash-replica and alter-table-placement ddl Sep 25, 2024
@joccau
Copy link
Member Author

joccau commented Sep 25, 2024

/retest

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 25, 2024
Copy link

ti-chi-bot bot commented Sep 25, 2024

@joechenrh: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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/test-infra repository.

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

@@ -565,20 +565,21 @@ func (e *executor) ModifySchemaSetTiFlashReplica(sctx sessionctx.Context, stmt *
}

job := &model.Job{
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe in future, we can have a newJob function to avoid the job constructor changes need to be edit at many places

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea~

if ref == nil {
continue
}
involvingSchemaInfo = append(involvingSchemaInfo, model.InvolvingSchemaInfo{
Copy link
Contributor

Choose a reason for hiding this comment

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

where does it move to?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the ActionAlterTablePlacement ddl is not belong to multiSchemaChange. It's useless.

@joccau
Copy link
Member Author

joccau commented Sep 25, 2024

/test pull-br-integration-test

Copy link

tiprow bot commented Sep 25, 2024

@joccau: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test fast_test_tiprow
  • /test fast_test_tiprow_ddl
  • /test tidb_parser_test

Use /test all to run the following jobs that were automatically triggered:

  • fast_test_tiprow
  • tidb_parser_test

In response to this:

/test pull-br-integration-test

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.

@lance6716
Copy link
Contributor

/approve

@lance6716
Copy link
Contributor

/lgtm

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 25, 2024
Copy link

ti-chi-bot bot commented Sep 25, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-25 07:25:52.450117255 +0000 UTC m=+1637222.190541193: ☑️ agreed by D3Hunter.
  • 2024-09-25 08:20:32.933811517 +0000 UTC m=+1640502.674235457: ☑️ agreed by lance6716.

Copy link

ti-chi-bot bot commented Sep 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, joechenrh, lance6716

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

@joccau
Copy link
Member Author

joccau commented Sep 25, 2024

/retest

@joccau
Copy link
Member Author

joccau commented Sep 26, 2024

/retest

2 similar comments
@D3Hunter
Copy link
Contributor

/retest

@D3Hunter
Copy link
Contributor

/retest

@D3Hunter
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit 9dff38b into pingcap:master Sep 26, 2024
25 checks passed
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants