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

planner, executor: allow build root task type of expand operator and implement expand executor #54536

Merged
merged 11 commits into from
Jul 24, 2024

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented Jul 10, 2024

What problem does this PR solve?

Issue Number: close #42631

Problem Summary:

What changed and how does it work?

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 ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 10, 2024
Copy link

tiprow bot commented Jul 10, 2024

Hi @AilinKid. 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-sigs/prow repository.

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 78.26087% with 30 lines in your changes missing coverage. Please review.

Project coverage is 56.8239%. Comparing base (5e872b9) to head (bb827e4).
Report is 77 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54536         +/-   ##
=================================================
- Coverage   72.7920%   56.8239%   -15.9681%     
=================================================
  Files          1551       1682        +131     
  Lines        436754     628114     +191360     
=================================================
+ Hits         317922     356919      +38997     
- Misses        99241     247552     +148311     
- Partials      19591      23643       +4052     
Flag Coverage Δ
integration 37.2439% <78.2608%> (?)
unit 71.7376% <39.8550%> (-0.0869%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.0237% <ø> (+6.1880%) ⬆️

AilinKid and others added 9 commits July 16, 2024 16:09
Signed-off-by: AilinKid <314806019@qq.com>
.
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
.
Signed-off-by: AilinKid <314806019@qq.com>
/
Signed-off-by: AilinKid <314806019@qq.com>
.
Signed-off-by: AilinKid <314806019@qq.com>
pkg/config/config.go Outdated Show resolved Hide resolved
pkg/executor/expand.go Show resolved Hide resolved
pkg/executor/expand.go Show resolved Hide resolved
Copy link
Contributor

@elsa0520 elsa0520 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 Jul 19, 2024
@elsa0520 elsa0520 self-requested a review July 19, 2024 06:01
// for property.RootTaskType and property.MppTaskType with no partition option, we can give an MPP Expand.
if p.SCtx().GetSessionVars().IsMPPAllowed() {
canPushToTiFlash := p.CanPushToCop(kv.TiFlash)
Copy link
Contributor

Choose a reason for hiding this comment

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

"CanPushToCop" This function name is strange. Cop is a protocol name but TiFlash already deprecated TiFlashCop and only keep the TiFlash[MPP]

Copy link
Contributor Author

@AilinKid AilinKid Jul 24, 2024

Choose a reason for hiding this comment

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

yes, borrowed from old logic, i think it should be renamed as p.CanPushToEngine, since your argument is engine type, the name will be more accurate.

return nil, true, nil
// for property.RootTaskType, we can give a TiDB Expand.
{
taskTypes := []property.TaskType{property.CopSingleReadTaskType, property.CopMultiReadTaskType, property.RootTaskType}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to keep all taskTypes in here? Because there is only expand operator in tidb, so why we still need to keep copsingle and copmulti?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when we come here, the prop asks for a root expand execution, while for its children prop, there is no limitation here.

Expand(Root)
 + IndexReader( from single cop prop)
     + IndexRangeScan

Expand(Root)
 + IndexLookupReader (from multi cop prop)
     + IndexRangeScan
     + TiDBRowIDScan

Expand(Root)
 + OtherRootOp(Root) (from root prop)
     + OtherOps 

Expand(Root)
 + OtherMppOps (Mpp) (from mpp prop)
     + OtherOps 

the four cases here are all reasonable

pkg/planner/core/task.go Outdated Show resolved Hide resolved
pkg/planner/core/task.go Outdated Show resolved Hide resolved
AilinKid and others added 2 commits July 24, 2024 15:28
Co-authored-by: Elsa <111482174+elsa0520@users.noreply.github.com>
.
Signed-off-by: AilinKid <314806019@qq.com>
@ti-chi-bot ti-chi-bot bot added the approved label Jul 24, 2024
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Jul 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elsa0520, windtalker

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 Jul 24, 2024
Copy link

ti-chi-bot bot commented Jul 24, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-19 06:01:07.612707969 +0000 UTC m=+592889.603649438: ☑️ agreed by elsa0520.
  • 2024-07-24 09:18:36.151411523 +0000 UTC m=+1036738.142352977: ☑️ agreed by windtalker.

Copy link

tiprow bot commented Jul 24, 2024

@AilinKid: 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
fast_test_tiprow bb827e4 link true /test fast_test_tiprow

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-sigs/prow repository. I understand the commands that are listed here.

@AilinKid
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Jul 24, 2024

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

In response to this:

/retest-required

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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot merged commit cbe807f into pingcap:master Jul 24, 2024
22 of 23 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. sig/planner SIG: Planner 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.

Implement Underlying Grouping Sets
3 participants