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

executor: enable parallel sort #53537

Merged
merged 13 commits into from
Jun 6, 2024

Conversation

xzhangxian1008
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #53536

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 release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 24, 2024
Copy link

tiprow bot commented May 24, 2024

Hi @xzhangxian1008. 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 May 24, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 55.8316%. Comparing base (87d6f0f) to head (2f656d0).
Report is 2 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53537         +/-   ##
=================================================
- Coverage   70.9866%   55.8316%   -15.1550%     
=================================================
  Files          1507       1628        +121     
  Lines        413072     602735     +189663     
=================================================
+ Hits         293226     336517      +43291     
- Misses       100540     243084     +142544     
- Partials      19306      23134       +3828     
Flag Coverage Δ
integration 37.3151% <52.7777%> (?)
unit 71.5056% <63.8888%> (+1.5825%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (-2.2339%) ⬇️
parser ∅ <ø> (∅)
br 50.4687% <ø> (+6.9251%) ⬆️

@xzhangxian1008
Copy link
Contributor Author

/cc @yibin87 @windtalker

@ti-chi-bot ti-chi-bot bot requested review from windtalker and yibin87 May 24, 2024 08:14
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 24, 2024
pkg/executor/sortexec/sort.go Outdated Show resolved Hide resolved
pkg/executor/sortexec/sort.go Outdated Show resolved Hide resolved
pkg/executor/sortexec/sort.go Outdated Show resolved Hide resolved
pkg/executor/sortexec/sort.go Show resolved Hide resolved
@xzhangxian1008
Copy link
Contributor Author

/cc @windtalker @yibin87

@ti-chi-bot ti-chi-bot bot requested a review from windtalker May 27, 2024 03:15
@xzhangxian1008
Copy link
Contributor Author

/cc @windtalker @yibin87

@xzhangxian1008
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 28, 2024

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

@@ -272,9 +258,13 @@ func (e *SortExec) InitInParallelModeForTest() {
*/
func (e *SortExec) Next(ctx context.Context, req *chunk.Chunk) error {
if e.fetched.CompareAndSwap(false, true) {
e.initCompareFuncs()
err := e.initCompareFuncs()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should remember this error in SortExec, so if initCompareFuncs fails, every call of Next will return error, otherwise, the second call of Next will go to L266 directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you should remember this error in SortExec, so if initCompareFuncs fails, every call of Next will return error, otherwise, the second call of Next will go to L266 directly?

Next is called by only one go routine, and once it returns error Next will not be called anymore. I think it's needless to remember it in SortExec.

pkg/executor/sortexec/sort.go Outdated Show resolved Hide resolved
pkg/executor/sortexec/sort.go Outdated Show resolved Hide resolved
@xzhangxian1008
Copy link
Contributor Author

/cc @windtalker @yibin87

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

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 3, 2024
Copy link
Contributor

@yibin87 yibin87 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 Jun 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jun 3, 2024
Copy link

ti-chi-bot bot commented Jun 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-03 03:13:30.526097599 +0000 UTC m=+3264564.283233156: ☑️ agreed by windtalker.
  • 2024-06-03 05:51:10.326279713 +0000 UTC m=+3274024.083415286: ☑️ agreed by yibin87.

@ti-chi-bot ti-chi-bot bot merged commit 793530a into pingcap:master Jun 6, 2024
20 of 21 checks passed
@xzhangxian1008 xzhangxian1008 deleted the enable-parallel-sort branch June 6, 2024 04:49
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/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.

Enable parallel sort
3 participants