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

ddl: set writer memory size and merge part size by resource #52329

Merged
merged 4 commits into from Apr 15, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Apr 3, 2024

What problem does this PR solve?

Issue Number: close #52328

Problem Summary:

What changed and how does it work?

Complies with the resource usage restrictions of the dist task framework.

Before this PR:

[2024/04/11 07:17:31.146 +00:00] [INFO] [backfilling_operators.go:130] ["build operators that write index to cloud storage"] ["memory total"=29360128000] ["memory used"=1461342208] ["memory size"=1162449408]
[2024/04/11 08:17:11.197 +00:00] [INFO] [backfilling_operators.go:130] ["build operators that write index to cloud storage"] ["memory total"=29360128000] ["memory used"=24287723520] ["memory size"=211350186]
[2024/04/11 09:07:54.000 +00:00] [INFO] [backfilling_operators.go:130] ["build operators that write index to cloud storage"] ["memory total"=29360128000] ["memory used"=11104190464] ["memory size"=760664064]

The memory size is very unstable.

After this PR:

[2024/04/12 06:18:01.685 +00:00] [INFO] [backfilling_operators.go:231] ["build add index cloud storage operators"] [task-id=30001] [subtask-id=30001] [jobID=108] [memCap=6.836GiB] [memSizePerIdx=291.7MiB] [avgRowSize=247] [reader=4] [writer=4]
[2024/04/12 07:11:21.145 +00:00] [INFO] [backfilling_operators.go:231] ["build add index cloud storage operators"] [task-id=30001] [subtask-id=30002] [jobID=108] [memCap=6.836GiB] [memSizePerIdx=291.7MiB] [avgRowSize=247] [reader=4] [writer=4]
[2024/04/12 08:03:45.901 +00:00] [INFO] [backfilling_operators.go:231] ["build add index cloud storage operators"] [task-id=30001] [subtask-id=30003] [jobID=108] [memCap=6.836GiB] [memSizePerIdx=291.7MiB] [avgRowSize=247] [reader=4] [writer=4]

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 3, 2024
Copy link

tiprow bot commented Apr 3, 2024

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

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Merging #52329 (23850e4) into master (5814957) will increase coverage by 2.1557%.
Report is 6 commits behind head on master.
The diff coverage is 81.2500%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52329        +/-   ##
================================================
+ Coverage   72.3519%   74.5076%   +2.1557%     
================================================
  Files          1470       1471         +1     
  Lines        427187     431988      +4801     
================================================
+ Hits         309078     321864     +12786     
+ Misses        98865      90215      -8650     
- Partials      19244      19909       +665     
Flag Coverage Δ
integration 48.8212% <81.2500%> (?)

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 49.7594% <ø> (+8.6560%) ⬆️

@ywqzzy ywqzzy self-requested a review April 3, 2024 04:23
Copy link

ti-chi-bot bot commented Apr 11, 2024

@tangenta: 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
pull-lightning-integration-test a456cfa link true /test pull-lightning-integration-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.

@ywqzzy
Copy link
Contributor

ywqzzy commented Apr 15, 2024

/lgtm

@@ -88,16 +88,15 @@ func (m *mergeSortExecutor) RunSubtask(ctx context.Context, subtask *proto.Subta
}

prefix := path.Join(strconv.Itoa(int(m.jobID)), strconv.Itoa(int(subtask.ID)))
partSize, err := getMergeSortPartSize(m.avgRowSize, subtask.Concurrency, m.idxNum)
Copy link
Contributor

Choose a reason for hiding this comment

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

m.avgRowSize is also not used any more

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link

ti-chi-bot bot commented Apr 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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

Copy link

ti-chi-bot bot commented Apr 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-15 04:01:18.347302114 +0000 UTC m=+224297.458348562: ☑️ agreed by ywqzzy.
  • 2024-04-15 05:43:27.4485614 +0000 UTC m=+230426.559607850: ☑️ agreed by lance6716.

@lance6716
Copy link
Contributor

/hold

a little comment

@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 Apr 15, 2024
@lance6716
Copy link
Contributor

/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 Apr 15, 2024
@ti-chi-bot ti-chi-bot bot merged commit 6d52fa6 into pingcap:master Apr 15, 2024
21 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #52603.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-8.1 release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global sort add index should use fixed memory size
4 participants