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, disttask: allow multi import job & adjust total memory for cgroup v2 #51575

Merged
merged 18 commits into from
Mar 14, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Mar 7, 2024

What problem does this PR solve?

Issue Number: ref #49008

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

on a cgroup v2 32c64g node, physical mem is 62.9GiB and from cgroup we got 64GiB, but the real usable memory is 57.35GiB

before

[2024/03/11 04:45:31.337 +00:00] [INFO] [manager.go:94] ["build task executor manager"] [total-cpu=32] [total-mem=62.9GiB]

after

[2024/03/12 16:56:20.409 +00:00] [INFO] [manager.go:108] ["adjust memory limit for cgroup v2"] [before=62.9GiB] [after=56.32GiB]
[2024/03/12 16:56:20.409 +00:00] [INFO] [manager.go:114] ["build task executor manager"] [total-cpu=32] [total-mem=56.32GiB]
  • 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 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 Mar 7, 2024
Copy link

tiprow bot commented Mar 7, 2024

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.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Merging #51575 (4f48b92) into master (478ab1f) will increase coverage by 1.9545%.
Report is 25 commits behind head on master.
The diff coverage is 57.1428%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51575        +/-   ##
================================================
+ Coverage   70.7436%   72.6982%   +1.9545%     
================================================
  Files          1474       1476         +2     
  Lines        437068     441701      +4633     
================================================
+ Hits         309198     321109     +11911     
+ Misses       108517     100493      -8024     
- Partials      19353      20099       +746     
Flag Coverage Δ
integration 49.0054% <42.8571%> (?)
unit 70.4923% <51.4285%> (-0.0687%) ⬇️

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

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

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 12, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 12, 2024
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 12, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 12, 2024
@D3Hunter D3Hunter changed the title [WIP]: Multi import job [WIP]: allow multi import job & adjust total memory for cgroup v2 Mar 13, 2024
@D3Hunter D3Hunter changed the title [WIP]: allow multi import job & adjust total memory for cgroup v2 [WIP]importinto, disttask: allow multi import job & adjust total memory for cgroup v2 Mar 13, 2024
@D3Hunter D3Hunter changed the title [WIP]importinto, disttask: allow multi import job & adjust total memory for cgroup v2 importinto, disttask: allow multi import job & adjust total memory for cgroup v2 Mar 13, 2024
@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 Mar 13, 2024
Benjamin2037
Benjamin2037 previously approved these changes Mar 13, 2024
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 the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 13, 2024
@D3Hunter D3Hunter dismissed Benjamin2037’s stale review March 13, 2024 13:19

code changed a little

@D3Hunter D3Hunter removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 13, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Mar 13, 2024
@D3Hunter
Copy link
Contributor Author

/approve cancel

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Mar 13, 2024

@D3Hunter: 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.

@D3Hunter
Copy link
Contributor Author

manually test again after code change

[2024/03/13 16:44:56.899 +00:00] [INFO] [manager.go:106] ["adjust memory limit for cgroup v2"] [before=62.9GiB] [after=56.32GiB]
[2024/03/13 16:44:56.899 +00:00] [INFO] [manager.go:111] ["build task executor manager"] [total-cpu=32] [total-mem=56.32GiB]

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

Copy link

ti-chi-bot bot commented Mar 14, 2024

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

In response to this:

LGTM

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.

@@ -91,6 +92,22 @@ func NewManager(ctx context.Context, id string, taskTable TaskTable) (*Manager,
if totalCPU <= 0 || totalMem <= 0 {
return nil, errors.Errorf("invalid cpu or memory, cpu: %d, memory: %d", totalCPU, totalMem)
}
cgroupLimit, version, err := cgroup.GetCgroupMemLimit()
// ignore the error of cgroup.GetCgroupMemLimit, as it's not a must-success step.
if err == nil && version == cgroup.V2 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

From the code, it seems only the Cgroup V2 return mem limit should be adjusted.

Copy link
Contributor Author

@D3Hunter D3Hunter Mar 14, 2024

Choose a reason for hiding this comment

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

yes, v1 returns the hierarchy mem limit which is what we expect

Copy link

ti-chi-bot bot commented Mar 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, 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 approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 14, 2024
Copy link

ti-chi-bot bot commented Mar 14, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-13 07:35:39.245708237 +0000 UTC m=+843766.267954625: ☑️ agreed by Benjamin2037.
  • 2024-03-14 03:52:28.819535533 +0000 UTC m=+916775.841781921: ☑️ agreed by lance6716.

@ti-chi-bot ti-chi-bot bot merged commit dbdae85 into pingcap:master Mar 14, 2024
23 checks passed
@D3Hunter D3Hunter deleted the multi-import-job branch March 14, 2024 05:06
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants