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

Backup: remove improper memory usage during full backup #58591

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

3pointer
Copy link
Contributor

@3pointer 3pointer commented Dec 27, 2024

What problem does this PR solve?

Issue Number: close #58587
Problem Summary:
When performing a full backup on millions of tables, the default incomplete range buffer grows significantly due to the large number of ranges. Since most ranges are complete, a lower buffer value should be used to optimize memory usage.

What changed and how does it work?

Set default incomplete to a lower value.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    Manually Backup millions of tables
    Before this PR, the inuse memory consume 4GB with GetIncompleteRanges
    image

After the memory usage reduced.
image

  • 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

Copy link

ti-chi-bot bot commented Dec 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added 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. do-not-merge/needs-triage-completed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 27, 2024
@3pointer 3pointer changed the title Backup: remove uninefficient memory usage during full backup Backup: remove inefficient memory usage during full backup Dec 27, 2024
Copy link

tiprow bot commented Dec 27, 2024

Hi @3pointer. 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.

@3pointer 3pointer changed the title Backup: remove inefficient memory usage during full backup Backup: remove improper memory usage during full backup Dec 27, 2024
@3pointer 3pointer marked this pull request as ready for review December 30, 2024 03:04
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed labels Dec 30, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 30, 2024
Copy link

ti-chi-bot bot commented Dec 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BornChanger, Leavrth

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 Dec 30, 2024
Copy link

ti-chi-bot bot commented Dec 30, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-30 03:09:07.224845107 +0000 UTC m=+319882.580849675: ☑️ agreed by Leavrth.
  • 2024-12-30 03:11:43.01205888 +0000 UTC m=+320038.368063419: ☑️ agreed by BornChanger.

Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.7726%. Comparing base (3c40731) to head (55628c7).
Report is 15 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58591        +/-   ##
================================================
+ Coverage   73.5554%   74.7726%   +1.2171%     
================================================
  Files          1680       1695        +15     
  Lines        464640     469847      +5207     
================================================
+ Hits         341768     351317      +9549     
+ Misses       102005      96783      -5222     
- Partials      20867      21747       +880     
Flag Coverage Δ
integration 46.0256% <100.0000%> (?)
unit 72.3014% <100.0000%> (+0.0120%) ⬆️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.6477% <100.0000%> (+15.8732%) ⬆️

@3pointer
Copy link
Contributor Author

/test pull-br-integration-test

Copy link

tiprow bot commented Dec 30, 2024

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

@ti-chi-bot ti-chi-bot bot merged commit 3ac2b49 into pingcap:master Dec 30, 2024
34 of 37 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backup: Inefficient memory usage in the RangeTree, when there are millions of tables.
3 participants