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

Add OnMemChange to support memory tracing of LockCtx #1301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RemHero
Copy link

@RemHero RemHero commented Apr 18, 2024

What problem does this PR solve?

Issue Number: close #51217

Problem Summary:
The memory consumed in InitCheckExistence is not tracked by the memory tracker.Related PR.

What changed and how does it work?

This PR adds the OnMemChange method to InitCheckExistence. In addition, two functions GetValuesKSize and GetValuesVSize are added to account for the memory occupied by Key(string) and Value(ReturnedValue) in the declared map structure.

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.

@RemHero
Copy link
Author

RemHero commented Apr 22, 2024

@ekexium
Hello! I have submitted client-go #1301 and TiDB pingcap/tidb#52739. It should be noted that the structure of LockCtx in client-go is changed, but the client-go version referenced in TiDB is v2. Even if PR in client-go is merged, it cannot make TiDB perceive the structural change of LockCtx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Track memory usage in pessimistic locking phase
1 participant