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

importinto: refactor chunk processor #47489

Merged
merged 5 commits into from
Oct 10, 2023

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Oct 9, 2023

What problem does this PR solve?

Issue Number: ref #46704

Problem Summary:

What is changed and how it works?

split data encoder and delivery, so we can add a new delivery for global sort which only allow 1 writer for each index or data in current design, so we can avoid locking everywhere.

move some metric from deliver loop into encoder loop

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    a case of 158.8GB, takes 1406s(after) vs 1382s(before)
  • 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 9, 2023
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Oct 9, 2023

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Oct 9, 2023
@tiprow
Copy link

tiprow bot commented Oct 9, 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.

@D3Hunter
Copy link
Contributor Author

D3Hunter commented Oct 9, 2023

/test all

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Merging #47489 (3ea3eb5) into master (00d53be) will increase coverage by 0.6480%.
Report is 19 commits behind head on master.
The diff coverage is 61.7391%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47489        +/-   ##
================================================
+ Coverage   72.1550%   72.8030%   +0.6480%     
================================================
  Files          1352       1375        +23     
  Lines        401092     407671      +6579     
================================================
+ Hits         289408     296797      +7389     
+ Misses        92443      92037       -406     
+ Partials      19241      18837       -404     
Flag Coverage Δ
integration 39.5831% <0.0000%> (?)
unit 72.1713% <61.7391%> (+0.0163%) ⬆️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser 84.6681% <ø> (ø)
br 48.8805% <ø> (-4.3124%) ⬇️

lance6716
lance6716 previously approved these changes Oct 9, 2023
})
group.Go(func() error {
defer p.encodeDone(gCtx)
return p.enc.encodeLoop(gCtx)
Copy link
Contributor

Choose a reason for hiding this comment

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

I slightly prefer we use a local variable kvsCh, so it's more obvious how these two loops interact with each other and how closing channel represents one loop is done . However it will make encapsulation (like sendFn) more difficult. LGTM

executor/importer/chunk_process_testkit_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 9, 2023
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Oct 9, 2023

/hold

encode speed drop a little for a case of 158.8GB, about 5%(1382s -> 1461s)
image

before
image

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2023
@D3Hunter
Copy link
Contributor Author

D3Hunter commented Oct 9, 2023

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 10, 2023

@lance6716: Your lgtm message is repeated, so it is ignored.

In response to this:

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 approved label Oct 10, 2023
Copy link
Contributor

@GMHDBJD GMHDBJD 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 Oct 10, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: GMHDBJD, lance6716

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 Oct 10, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 10, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-09 13:24:41.506222245 +0000 UTC m=+1058679.093332391: ☑️ agreed by lance6716.
  • 2023-10-10 02:56:37.140260371 +0000 UTC m=+1107394.727370500: ☑️ agreed by GMHDBJD.

@D3Hunter
Copy link
Contributor Author

/reteset

@D3Hunter
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 41ba7bf into pingcap:master Oct 10, 2023
13 of 16 checks passed
@D3Hunter D3Hunter deleted the refactor-chunk-processor branch October 10, 2023 03:48
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.

3 participants