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

disttask/ddl: fix pause succeed task then run a new task #47804

Merged
merged 10 commits into from
Oct 23, 2023

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Oct 19, 2023

What problem does this PR solve?

Issue Number: close #47805

Problem Summary:
The pause ddl job was triggered after the task was successfully completed, and at this point, the task had already been moved to the history table. After resuming the ddl, the table was not queried from the history table, resulting in the framework reopening the task and running it all over again.

What is changed and how it works?

  1. Use Channel to make sure the pause cmd actually works.
  2. Fetch task from global_task table and history table to make sure the task only run once.

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.

optimize the pause&resume process when a dist task succeed.

@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/needs-tests-checked size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Oct 19, 2023
@tiprow
Copy link

tiprow bot commented Oct 19, 2023

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

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 19, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Oct 19, 2023
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #47804 (fcb5774) into master (b584055) will increase coverage by 1.0810%.
Report is 1 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47804        +/-   ##
================================================
+ Coverage   71.7482%   72.8293%   +1.0810%     
================================================
  Files          1400       1424        +24     
  Lines        405579     416129     +10550     
================================================
+ Hits         290996     303064     +12068     
+ Misses        94846      93949       -897     
+ Partials      19737      19116       -621     
Flag Coverage Δ
integration 42.4868% <0.0000%> (?)
unit 71.7249% <0.0000%> (-0.0234%) ⬇️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser ∅ <ø> (∅)
br 48.7447% <ø> (-4.2967%) ⬇️

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 19, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 19, 2023

/retest

1 similar comment
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 20, 2023

/retest

@ywqzzy ywqzzy changed the title disttask/ddl: fix flaky test disttask/ddl: fix pause succeed task then run 啊 Oct 20, 2023
@ywqzzy ywqzzy changed the title disttask/ddl: fix pause succeed task then run 啊 disttask/ddl: fix pause succeed task then run a new task Oct 20, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 20, 2023

/test mysql-test

@tiprow
Copy link

tiprow bot commented Oct 20, 2023

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

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

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

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 20, 2023

/retest

@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. labels Oct 20, 2023
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Oct 23, 2023
taskManager, err := storage.GetTaskManager()
if err != nil {
return err
}
task, err := taskManager.GetGlobalTaskByKey(taskKey)
task, err := taskManager.GetGlobalTaskByKeyWithHistory(taskKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

why paused task moved into history?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why paused task moved into history?

It has possiblity that the dist task was finished but the ddl job was paused.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. do-not-merge/needs-triage-completed and removed do-not-merge/needs-triage-completed labels Oct 23, 2023
Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, D3Hunter

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:
  • OWNERS [Benjamin2037,D3Hunter]

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

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 23, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 23, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-23 09:50:58.301971468 +0000 UTC m=+2255455.889081612: ☑️ agreed by D3Hunter.
  • 2023-10-23 10:06:39.097151899 +0000 UTC m=+2256396.684262047: ☑️ agreed by Benjamin2037.

@tiprow
Copy link

tiprow bot commented Oct 23, 2023

@ywqzzy: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test fcb5774 link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 23, 2023

/retest

@ti-chi-bot ti-chi-bot bot merged commit 0901886 into pingcap:master Oct 23, 2023
11 of 16 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #47935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ddl: TestAddIndexDistPauseAndResume failed
4 participants