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: refactor task step and batch subtask dispatching #46957

Merged
merged 8 commits into from
Sep 14, 2023

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Sep 13, 2023

What problem does this PR solve?

Issue Number: ref #46258

Problem Summary:

  • revert StepInit to -1 and StepImport to 1 to avoid potential compatibility issue
  • remove StageFinished and Finished, add GetNextStep
  • successfully task MUST go from StepInit to business steps, then StepDone.

since subtask metas might be too large to save in one transaction,
we plan to save subtasks in batch later, so add this:
invariant: task.Step always means the most recent step that all
corresponding subtasks have been saved to system table.

when all subtasks of task.Step is finished, we call OnNextSubtasksBatch
to generate subtasks of next step. after all subtasks of next step are
saved to system table, we will update task.Step to next step, so the
invariant hold.

What is changed and how it works?

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 ti-chi-bot bot added 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 13, 2023
@D3Hunter
Copy link
Contributor Author

/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 13, 2023
@tiprow
Copy link

tiprow bot commented Sep 13, 2023

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

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #46957 (bad731a) into master (a43344d) will decrease coverage by 0.2117%.
Report is 7 commits behind head on master.
The diff coverage is 90.7692%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46957        +/-   ##
================================================
- Coverage   73.2442%   73.0326%   -0.2117%     
================================================
  Files          1332       1357        +25     
  Lines        397646     406299      +8653     
================================================
+ Hits         291253     296731      +5478     
- Misses        87747      90955      +3208     
+ Partials      18646      18613        -33     
Flag Coverage Δ
integration 29.0708% <0.0000%> (?)
unit 73.5819% <90.7692%> (+0.3376%) ⬆️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser 85.2377% <ø> (+0.2574%) ⬆️
br 48.6184% <ø> (-4.2638%) ⬇️

@D3Hunter D3Hunter changed the title [WIP]disttask: refactor task step and batch subtask dispatching disttask: refactor task step and batch subtask dispatching Sep 14, 2023
@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 14, 2023
@D3Hunter
Copy link
Contributor Author

/retest

@@ -94,6 +91,7 @@ func TestFrameworkDynamicBasic(t *testing.T) {
}

func TestFrameworkDynamicHA(t *testing.T) {
t.Skip("skip this test because the function is not implemented yet")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why skip it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted e573f2d

@hawkingrei
Copy link
Member

/retest

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

@ywqzzy ywqzzy 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 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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

ti-chi-bot bot commented Sep 14, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-14 09:43:23.875523126 +0000 UTC m=+164969.843111176: ☑️ agreed by wjhuang2016.
  • 2023-09-14 09:44:30.335884434 +0000 UTC m=+165036.303472483: ☑️ agreed by ywqzzy.

@hawkingrei
Copy link
Member

/retest

@D3Hunter
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit ae3f595 into pingcap:master Sep 14, 2023
14 of 16 checks passed
@D3Hunter D3Hunter deleted the init-step branch September 14, 2023 16:57
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants