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

disktask: replace failure nodes with alive ones #45935

Merged
merged 12 commits into from
Sep 4, 2023
Merged

Conversation

xhebox
Copy link
Contributor

@xhebox xhebox commented Aug 9, 2023

What problem does this PR solve?

Issue Number: ref #46258

Problem Summary: This PR adds a simple mechanism to cancel existed subtask.

What is changed and how it works?

Dispatcher:

  1. fetches liveNodes from etcd every DefaultLiveNodesCheckTick ticks in handleRunning.
  2. lazily fetched taskNodes in handleRunning as a local cache.
  3. If some of taskNodes are absent from liveNodes, it is marked as failure. And random nodes liveNodes will replace them. It is done by UpdateFailedSchedulerIDs. The local cache is also updated.

Scheduler:

  1. starts a background task every Run(..) for checking if the scheduler has been canceled by dispatcher. If so, call runtimeCancel.

Check List

Tests

  • Unit test
    • 3 subtasks
      • 4 nodes. 3 nodes are hung up, then the task is forwarded to the rest nodes and executed successfully.
      • 30 nodes. 3 nodes are hung up, then the task is forwarded to the rest nodes and executed successfully.
    • 10 subtasks in the first stage, 5 subtasks in the second stage
      • 4 nodes. 3 nodes are hung up in the first stage, then the task is forwarded to the rest nodes and executed successfully.
      • 30 nodes, 3 nodes are hung up in the first stage, then the task is forwarded to the rest nodes and executed successfully.
      • 6 nodes. 3 nodes are hung up in the first stage, 1 tidb node in the second stage hangs up. The task is forwarded to the rest nodes and executed successfully.
      • 30 nodes, 3 nodes are hung up in the first stage, 1 tidb node in the second stage hangs up. The task is forwarded to the rest nodes and executed successfully.
    • Node network isolated and restored
      • 4 nodes. 3 nodes are isolated from the network and recovered. These nodes no longer pick tasks, and the other nodes execute all subtasks.
      • 30 nodes. 3 nodes are isolated from the network and recovered. These nodes no longer pick tasks, and the other nodes execute all subtasks.
  • 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 Aug 9, 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/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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 9, 2023
@tiprow
Copy link

tiprow bot commented Aug 9, 2023

Hi @xhebox. 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.

@xhebox
Copy link
Contributor Author

xhebox commented Aug 10, 2023

/run-all-tests

@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 Aug 22, 2023
@xhebox xhebox marked this pull request as ready for review August 22, 2023 07:14
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue labels Aug 22, 2023
disttask/framework/dispatcher/dispatcher.go Outdated Show resolved Hide resolved
disttask/framework/dispatcher/dispatcher.go Outdated Show resolved Hide resolved
disttask/framework/scheduler/manager.go Outdated Show resolved Hide resolved
disttask/framework/dispatcher/dispatcher.go Outdated Show resolved Hide resolved
@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 Aug 23, 2023
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #45935 (92ff681) into master (a427113) will decrease coverage by 0.6077%.
Report is 4 commits behind head on master.
The diff coverage is 79.6116%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #45935        +/-   ##
================================================
- Coverage   73.3303%   72.7226%   -0.6078%     
================================================
  Files          1310       1331        +21     
  Lines        394940     401568      +6628     
================================================
+ Hits         289611     292031      +2420     
- Misses        86881      91048      +4167     
- Partials      18448      18489        +41     
Flag Coverage Δ
integration 25.4447% <0.0000%> (?)
unit 73.4115% <83.6734%> (+0.0811%) ⬆️

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

Components Coverage Δ
dumpling 54.0444% <ø> (ø)
parser 84.9628% <ø> (+0.0108%) ⬆️
br 48.0377% <ø> (-4.2826%) ⬇️

@ywqzzy
Copy link
Contributor

ywqzzy commented Aug 25, 2023

/retest

@tiprow
Copy link

tiprow bot commented Aug 25, 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.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 30, 2023
@xhebox xhebox requested a review from tangenta August 30, 2023 06:52
@ywqzzy
Copy link
Contributor

ywqzzy commented Aug 31, 2023

/cc @GMHDBJD

@ti-chi-bot ti-chi-bot bot requested a review from GMHDBJD August 31, 2023 09:46
xhebox and others added 7 commits September 4, 2023 11:09
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Co-authored-by: tangenta <tangenta@126.com>
xhebox and others added 5 commits September 4, 2023 11:42
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
@ywqzzy
Copy link
Contributor

ywqzzy commented Sep 4, 2023

/retest

@tiprow
Copy link

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

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tangenta, 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 approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 4, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 4, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-08-30 02:55:45.047838637 +0000 UTC m=+1895709.596854624: ☑️ agreed by ywqzzy.
  • 2023-09-04 07:01:10.787664033 +0000 UTC m=+2342435.336680021: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit 1901239 into pingcap:master Sep 4, 2023
13 of 18 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants