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: S3 concurrent reader releases memory after it's not used #47239

Merged
merged 20 commits into from
Oct 7, 2023

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Sep 25, 2023

What problem does this PR solve?

Issue Number: ref #45719

Problem Summary:

What is changed and how it works?

When turn off concurrent reader, free the memory immediately.

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.

run TestMemoryUsageWhenHotspotChange
before

    iter_test.go:486: memory usage: 10518528 -> 7654735872

after

    iter_test.go:493: memory usage: 10706944 -> 944136192

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 do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 25, 2023
@tiprow
Copy link

tiprow bot commented Sep 25, 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.

@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 25, 2023
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 25, 2023
@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #47239 (145aabf) into master (cc42e4b) will increase coverage by 0.4309%.
The diff coverage is 85.5263%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47239        +/-   ##
================================================
+ Coverage   72.2961%   72.7270%   +0.4309%     
================================================
  Files          1352       1373        +21     
  Lines        400865     407305      +6440     
================================================
+ Hits         289810     296221      +6411     
- Misses        91856      92302       +446     
+ Partials      19199      18782       -417     
Flag Coverage Δ
integration 38.6783% <0.0000%> (?)
unit 72.2940% <85.5263%> (-0.0022%) ⬇️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser 84.7544% <ø> (-0.0108%) ⬇️
br 48.8583% <85.5263%> (-4.2259%) ⬇️

Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
@lance6716 lance6716 changed the title [WIP] external: S3 concurrent reader release memory after it's not used external: S3 concurrent reader release memory after it's not used Sep 27, 2023
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 27, 2023
@lance6716 lance6716 changed the title external: S3 concurrent reader release memory after it's not used external: S3 concurrent reader releases memory after it's not used Sep 27, 2023
Signed-off-by: lance6716 <lance6716@gmail.com>
var ConcurrentReaderBufferSize = 4 * 1024 * 1024
var (
// ConcurrentReaderBufferSize is the buffer size for concurrent reader.
ConcurrentReaderBufferSize = 4 * 1024 * 1024
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this mean reader buffer size 4M?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's per concurrency of a reader, I'll rename it.

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>
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

Rest LGTM

Signed-off-by: lance6716 <lance6716@gmail.com>
@tangenta
Copy link
Contributor

/lgtm

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 27, 2023
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 7, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 7, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-27 09:04:19.691817257 +0000 UTC m=+6257.278927401: ☑️ agreed by tangenta.
  • 2023-10-07 05:23:12.184306667 +0000 UTC m=+856989.771416811: ☑️ agreed by wjhuang2016.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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 the approved label Oct 7, 2023
@lance6716
Copy link
Contributor Author

/retest

@tiprow
Copy link

tiprow bot commented Oct 7, 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 ti-chi-bot bot merged commit fec9a5b into pingcap:master Oct 7, 2023
12 of 18 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants