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: dynamic dispatch subtasks #46593

Merged
merged 52 commits into from
Sep 12, 2023
Merged

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Sep 1, 2023

What problem does this PR solve?

Issue Number: ref #46258

Problem Summary:
In previous implementation, we batch all subtasks in one txn to submit subtasks.
It's possible that all subtasks are big then the size will up to txn limit.
And generating all subtasks will be slow, which will make some tidb workers idle.
image

What is changed and how it works?

Generate and dispatch subtasks in multiple txns.
In DispatcherExt, add the following 2 intefaces:

  1. Finished(task *proto.Task) bool: When return true, mark the task as succeed.
  2. StageFinished(task *proto.Task) bool: When return true, update the task step++.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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 1, 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 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 1, 2023
@tiprow
Copy link

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

@ti-chi-bot ti-chi-bot 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 Sep 4, 2023
@ywqzzy ywqzzy changed the title [WIP]disttask: dynamic dispatch [WIP]disttask: dynamic dispatch subtasks Sep 4, 2023
@ywqzzy ywqzzy changed the title [WIP]disttask: dynamic dispatch subtasks disttask: dynamic dispatch subtasks Sep 4, 2023
@ywqzzy ywqzzy marked this pull request as ready for review September 4, 2023 05:41
@ywqzzy ywqzzy requested a review from a team as a code owner September 4, 2023 05:41
@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 4, 2023
@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Merging #46593 (851a802) into master (4716f1b) will decrease coverage by 0.9174%.
The diff coverage is 43.3121%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46593        +/-   ##
================================================
- Coverage   73.3585%   72.4411%   -0.9174%     
================================================
  Files          1327       1348        +21     
  Lines        396878     405685      +8807     
================================================
+ Hits         291144     293883      +2739     
- Misses        87170      93076      +5906     
- Partials      18564      18726       +162     
Flag Coverage Δ
integration 27.7598% <0.0000%> (?)

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 84.9884% <ø> (-0.0135%) ⬇️
br 48.1946% <ø> (-4.5847%) ⬇️

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 4, 2023

I will remove the EnableDynamicDispatch column

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 11, 2023

/cc @wjhuang2016

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 11, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 11, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-08 10:11:25.691103795 +0000 UTC m=+4867.615660189: ☑️ agreed by Benjamin2037.
  • 2023-09-11 07:26:28.741965422 +0000 UTC m=+254170.666521816: ☑️ agreed by wjhuang2016.

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Sep 11, 2023

/retest

@tiprow
Copy link

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

@hawkingrei
Copy link
Member

/ok-to-test

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

ywqzzy commented Sep 11, 2023

/retest

@tiprow
Copy link

tiprow bot commented Sep 12, 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 851a802 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.

@ti-chi-bot ti-chi-bot bot merged commit dbb493f into pingcap:master Sep 12, 2023
10 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