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: fix wrong plan when filterByRole #48366

Merged
merged 5 commits into from
Nov 8, 2023

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Nov 7, 2023

What problem does this PR solve?

Issue Number: close #48368

Problem Summary:

  1. serverNodes used in OnNextStageBatch didn't filter by role.
  2. serverNodes may change during planning and dispatching phase, may lead to inconsistency of task nodes.

What is changed and how it works?

server:= d.GetEligibleInstance()
server:=d.filterByRole(server)
subtasks := d.OnNextStageBatch(server)
d.dispatchSubtasks(subtasks, server)

Using the above logic, the planner will use consistent serverNodes in plan and dispatching phase.

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.

Enhance planning of dist task

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked 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. and removed do-not-merge/needs-tests-checked labels Nov 7, 2023
Copy link

tiprow bot commented Nov 7, 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

codecov bot commented Nov 7, 2023

Codecov Report

Merging #48366 (9b692f1) into master (662528d) will increase coverage by 1.4269%.
Report is 16 commits behind head on master.
The diff coverage is 65.8536%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #48366        +/-   ##
================================================
+ Coverage   71.3789%   72.8058%   +1.4269%     
================================================
  Files          1402       1425        +23     
  Lines        406735     413354      +6619     
================================================
+ Hits         290323     300946     +10623     
+ Misses        96491      93468      -3023     
+ Partials      19921      18940       -981     
Flag Coverage Δ
integration 43.2722% <0.0000%> (?)
unit 71.3849% <65.8536%> (+0.0060%) ⬆️

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

Components Coverage Δ
dumpling 53.9874% <ø> (ø)
parser ∅ <ø> (∅)
br 48.6833% <ø> (-4.2296%) ⬇️

@ywqzzy ywqzzy changed the title disttask: fix inconsistance of plan instance and subtask instance. disttask: fix inconsistance of plan instance and subtask instance Nov 7, 2023
@ywqzzy ywqzzy changed the title disttask: fix inconsistance of plan instance and subtask instance disttask: fix inconsistence of plan instance and subtask instance Nov 7, 2023
@ywqzzy ywqzzy changed the title disttask: fix inconsistence of plan instance and subtask instance disttask: fix inconsistence of plan‘s serverNodes and dispatchSubtasks’ serverNodes Nov 7, 2023
@ywqzzy ywqzzy changed the title disttask: fix inconsistence of plan‘s serverNodes and dispatchSubtasks’ serverNodes disttask: fix wrong plan when filterByRole Nov 7, 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 Nov 7, 2023
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 8, 2023
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed do-not-merge/needs-triage-completed labels Nov 8, 2023
Co-authored-by: tangenta <tangenta@126.com>
Copy link

ti-chi-bot bot commented Nov 8, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Nov 8, 2023
Copy link

ti-chi-bot bot commented Nov 8, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-11-08 02:46:54.242888719 +0000 UTC m=+3612411.829998849: ☑️ agreed by D3Hunter.
  • 2023-11-08 04:01:32.486064818 +0000 UTC m=+3616890.073174962: ☑️ agreed by tangenta.

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Nov 8, 2023

/retest

Copy link

tiprow bot commented Nov 8, 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 Nov 8, 2023

/retest

Copy link

tiprow bot commented Nov 8, 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 merged commit d4618d4 into pingcap:master Nov 8, 2023
13 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: #48404.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Nov 8, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Nov 8, 2023
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add index and import into may generate wrong plan with more nodes
4 participants