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: support pause/resume for framework #47037

Merged
merged 18 commits into from
Sep 23, 2023

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Sep 18, 2023

What problem does this PR solve?

Issue Number: ref #46258

Problem Summary:

What is changed and how it works?

  1. When receive pause command
  • Dispatcher:

pausing state: check all subtasks paused.
paused state: exit the dispatcher.

  • Manager: pause and cancel all running subtasks, mark running/pending subtasks as Paused.
  1. When receive resume command:
  • Dispatcher: check all paused subtasks turn into pending state(not in paused state).
    If yes, turn task into running state.
    Else mark all paused subtasks into pending state.

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
Copy link

ti-chi-bot bot commented Sep 18, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Sep 18, 2023
@tiprow
Copy link

tiprow bot commented Sep 18, 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.

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 ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 18, 2023
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 20, 2023
@ywqzzy ywqzzy marked this pull request as ready for review September 20, 2023 09:12
@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 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #47037 (bc953f1) into master (9d29580) will decrease coverage by 0.3037%.
The diff coverage is 64.7343%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47037        +/-   ##
================================================
- Coverage   72.9812%   72.6775%   -0.3037%     
================================================
  Files          1340       1361        +21     
  Lines        400078     406549      +6471     
================================================
+ Hits         291982     295470      +3488     
- Misses        89194      92278      +3084     
+ Partials      18902      18801       -101     
Flag Coverage Δ
integration 32.3013% <7.6923%> (?)
unit 72.9862% <68.7179%> (+0.0049%) ⬆️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser 84.9484% <ø> (ø)
br 48.7398% <ø> (-4.3509%) ⬇️

@tiprow
Copy link

tiprow bot commented Sep 21, 2023

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

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 21, 2023

/ok-to-test

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 21, 2023

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

In response to this:

/ok-to-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.

1 similar comment
@tiprow
Copy link

tiprow bot commented Sep 21, 2023

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

In response to this:

/ok-to-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.

@zimulala zimulala added the ok-to-test Indicates a PR is ready to be tested. label Sep 21, 2023
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 21, 2023

/retest

1 similar comment
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 21, 2023

/retest

disttask/framework/handle/handle.go Outdated Show resolved Hide resolved
if err != nil {
return err
}
task, err := taskManager.GetGlobalTaskByKey(taskKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

We check this result in line140(through found), so could we remove this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We check this result in line140(through found), so could we remove this check?

I will change the resumeTask(int64) to resumeTask(string)

disttask/framework/storage/task_table.go Outdated Show resolved Hide resolved
disttask/framework/storage/task_table.go Outdated Show resolved Hide resolved
disttask/framework/storage/task_table.go Outdated Show resolved Hide resolved
Copy link
Contributor

@zimulala zimulala 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 Sep 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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

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

ti-chi-bot bot commented Sep 21, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-18 13:32:11.94047504 +0000 UTC m=+524297.908063092: ☑️ agreed by Benjamin2037.
  • 2023-09-21 08:33:14.513226993 +0000 UTC m=+765560.480815043: ☑️ agreed by zimulala.

@zimulala
Copy link
Contributor

Please fix the CI @ywqzzy

@wuhuizuo
Copy link
Contributor

/retest

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 22, 2023

/retest

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 22, 2023

/test all

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 23, 2023

/test all

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 23, 2023

/retest

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 23, 2023

/test tiprow_fast_test

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 23, 2023

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

  • /test build
  • /test canary-scan-security
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-br-integration-test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-ddl-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-prisma-test
  • /test pull-mysql-client-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test pull-notify-when-compatibility-sections-changed

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

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test

In response to this:

/test tiprow_fast_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.

@ti-chi-bot ti-chi-bot bot merged commit 34438f8 into pingcap:master Sep 23, 2023
12 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. 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.

4 participants