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

*: fix InContainer check for cgroup v2 #51669

Merged
merged 4 commits into from Mar 12, 2024
Merged

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Mar 11, 2024

What problem does this PR solve?

Issue Number: close #51668

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    before
[2024/03/11 09:54:43.469 +00:00] [INFO] [meminfo.go:196] ["use physical memory hook"] [cgroupMemorySize=68719476736] [physicalMemorySize=67536244736]

after

[2024/03/11 12:36:07.807 +00:00] [INFO] [meminfo.go:179] ["use cgroup memory hook because TiDB is in the container"]
[2024/03/11 12:36:07.808 +00:00] [INFO] [printer.go:47] ["Welcome to TiDB."] ["Release Version"=v7.5.0-incontainer2gcp] [Edition=Community] ["Git Commit Hash"=6bf81524079e80de19be644fc0ca43e1f98e0019] ["Git Branch"=heads/refs/tags/v7.5.0-incontainer2gcp] ["UTC Build Time"="2024-03-11 12:26:20"] [GoVersion=go1.21.6] ["Race Enabled"=false] ["Check Table Before Drop"=false]
  • 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 Mar 11, 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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 11, 2024
Copy link

tiprow bot commented Mar 11, 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.

@D3Hunter D3Hunter marked this pull request as ready for review March 11, 2024 10:30
@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 11, 2024
@purelind
Copy link
Contributor

/test mysql-test

Copy link

tiprow bot commented Mar 11, 2024

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

In response to this:

/test mysql-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

codecov bot commented Mar 11, 2024

Codecov Report

Merging #51669 (38d64d7) into master (2b63184) will increase coverage by 2.0229%.
Report is 7 commits behind head on master.
The diff coverage is 0.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51669        +/-   ##
================================================
+ Coverage   70.7224%   72.7454%   +2.0229%     
================================================
  Files          1473       1473                
  Lines        437089     437816       +727     
================================================
+ Hits         309120     318491      +9371     
+ Misses       108602      99270      -9332     
- Partials      19367      20055       +688     
Flag Coverage Δ
integration 48.7440% <0.0000%> (?)
unit 70.4696% <0.0000%> (-0.0520%) ⬇️

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

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

// see details from https://man7.org/linux/man-pages/man5/proc.5.html
if len(v) >= 8 && v[4] == "\\" && v[8] == "overlay" {
// TODO: enhance this check, as overlay is not the only storage driver for container.
if len(v) > 8 && v[8] == "overlay" {
Copy link
Member

Choose a reason for hiding this comment

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

You need to add tests for 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.

manually testing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated in pr desc

@hawkingrei
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 11, 2024
@D3Hunter
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 12, 2024
@D3Hunter
Copy link
Contributor Author

/hold

i will test it again manually, as the logic changed

@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 Mar 12, 2024
@D3Hunter
Copy link
Contributor Author

test again

2024-03-12 12:05:22 (UTC+08:00)TiDB tc-tidb-0.tc-tidb-peer.gsort-import-gcp-tps-7470320-1-17.svc:4000[meminfo.go:179] ["use cgroup memory hook because TiDB is in the container"]

@D3Hunter
Copy link
Contributor Author

/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 Mar 12, 2024
Copy link

ti-chi-bot bot commented Mar 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, hawkingrei

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:
  • OWNERS [Defined2014,hawkingrei]

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 Mar 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-12 03:07:01.755912369 +0000 UTC m=+741248.778158758: ☑️ agreed by Defined2014.
  • 2024-03-12 04:10:13.366019338 +0000 UTC m=+745040.388265723: ☑️ agreed by hawkingrei.

@ti-chi-bot ti-chi-bot bot merged commit 2d57833 into pingcap:master Mar 12, 2024
23 checks passed
@D3Hunter D3Hunter deleted the incontainer branch March 12, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test release-note-none 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.

InContainer fails to check on a GCP pod
4 participants