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
storage: reject new commands if memory quota exceeded (#16473) #16950
base: release-7.5
Are you sure you want to change the base?
storage: reject new commands if memory quota exceeded (#16473) #16950
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
ref tikv#16234 * txn: refactor task into a module * storage: refactor commands marco Signed-off-by: Neil Shen <overvenus@gmail.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ref tikv#16234 Currently, TiKV rejects new writes in the transaction layer if its pending write bytes exceed a default threshold of 100MB. However, this approach falls short as the transaction layer transforms a write request into a Command and executes it as a Future. Both Command and Future incur memory overhead. Empirical results from tests reveal that the memory usage of `kv_prewrite` is 20 times larger than its written bytes. This commit introduces a memory quota that restricts the transaction layer's memory usage. This addition acts as a crucial safeguard, serving as the last resort to prevent TiKV from OOM. Signed-off-by: Neil Shen <overvenus@gmail.com>
ref tikv#16234 * Add a metric of scheduler memory quota. * Add a metric of scheduler running commands. Signed-off-by: Neil Shen <overvenus@gmail.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
b518b9d
to
7e104f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/test |
@overvenus: The
In response to this:
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. |
This is an automated cherry-pick of #16473
This cherry-pick rolls up three PRs:
They are intended to be merged together.
What is changed and how it works?
Issue Number: ref #16234
What's Changed:
Related changes
Check List
Tests
Test Details
The OOM issue in #16234 is hard to reproduce reliable, so I have to changes the default configs.
A single-node Cluster with the following configs.
TiKV:
TiDB:
Workload:
Release note