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

external engine: support concurrent read and split into smaller data #47510

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

lance6716
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #45719

Problem Summary:

What is changed and how it works?

  • When the external engine contains less than 1000 files, we can open multiple iterators to concurrently read the data in given key ranges.
  • When the region size is larger than 2*96MB, generate region jobs per 96MB KV pairs so the large region still have enough concurrency

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

Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@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 10, 2023
@tiprow
Copy link

tiprow bot commented Oct 10, 2023

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

@lance6716
Copy link
Contributor Author

/test pull-br-integration-test

@tiprow
Copy link

tiprow bot commented Oct 10, 2023

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

In response to this:

/test pull-br-integration-test

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.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #47510 (e2cee99) into master (1b70096) will increase coverage by 2.8696%.
Report is 27 commits behind head on master.
The diff coverage is 83.1168%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47510        +/-   ##
================================================
+ Coverage   72.1485%   75.0182%   +2.8696%     
================================================
  Files          1353       1395        +42     
  Lines        401168     408042      +6874     
================================================
+ Hits         289437     306106     +16669     
+ Misses        92480      82124     -10356     
- Partials      19251      19812       +561     
Flag Coverage Δ
integration 45.2152% <15.5844%> (?)
unit 72.1517% <83.1168%> (+0.0031%) ⬆️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser 84.6574% <ø> (-0.0108%) ⬇️
br 65.6724% <88.8888%> (+12.4958%) ⬆️

) error {
// estimate we will open at most 1000 files, so if e.dataFiles is small we can
// try to concurrently process ranges.
concurrency := int(MergeSortOverlapThreshold) / len(e.dataFiles)
Copy link
Member

Choose a reason for hiding this comment

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

Set a lower/upper limit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 10, 2023
@lance6716
Copy link
Contributor Author

/test pull-br-integration-test

@tiprow
Copy link

tiprow bot commented Oct 10, 2023

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

In response to this:

/test pull-br-integration-test

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
Collaborator

@Benjamin2037 Benjamin2037 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 11, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 11, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-10 08:17:58.116547982 +0000 UTC m=+1126675.703658126: ☑️ agreed by wjhuang2016.
  • 2023-10-11 07:44:20.532747 +0000 UTC m=+1211058.119857131: ☑️ agreed by Benjamin2037.

return errors.Trace(e.iter.Close())
}
// Close implements common.Engine.
func (e *Engine) Close() error { return nil }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Doube confirm, external engine close do not need release any resource, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

For the rest lgtm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, local engine need to close its pebble DB. And before this PR external engine holds an iterator member that needs to be closed, but in this PR the iterator becomes a local variable that closed in line 144.

@lance6716
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot added the approved label Oct 11, 2023
@tiprow
Copy link

tiprow bot commented Oct 11, 2023

@lance6716: 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 Oct 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, tangenta, wjhuang2016, YuJuncen

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

@tiprow
Copy link

tiprow bot commented Oct 11, 2023

@lance6716: 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
tiprow_fast_test e2cee99 link true /test tiprow_fast_test

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

@ti-chi-bot ti-chi-bot bot merged commit aa99c16 into pingcap:master Oct 11, 2023
25 of 29 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/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.

5 participants