-
Notifications
You must be signed in to change notification settings - Fork 6k
lightning: unlimited grpc MaxCallRecvMsgSize for TikvImporter #56771
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
Conversation
Hi @fishiu. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
Hi @fishiu. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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-sigs/prow repository. |
Can you explain why choose 32 MB, is it enough? Or can we choose the value after we get the error message like DM? |
32 MB is not a precise number, I chose it only refering to the size mentioned in the issue. Or does @D3Hunter have any idea about the upper bounds in real scenarios? The way in DM is better. But I first need to locate places that use this client connection and wrap the recv process with adjust-and-retry logics. |
/ok-to-test |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #56771 +/- ##
=================================================
- Coverage 73.1861% 57.5678% -15.6183%
=================================================
Files 1655 1810 +155
Lines 456260 657299 +201039
=================================================
+ Hits 333919 378393 +44474
- Misses 101837 254123 +152286
- Partials 20504 24783 +4279
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I inspected the grpc source code regarding MaxCallRecvMsgSize and concluded that this option is only a numeric check to limit (memory/bandwidth) resource usage, i.e. setting MaxCallRecvMsgSize to large number will not directly consume large amount of memory. Actually in contrast, MaxCallSendMsgSize is by default maxInt32 in grpc. Therefore, the strategy to capture the error message and then retry with adjusted options seems to be equivalent with directly setting it to intMax initially. Additionally, the MaxCallRecvMsgSize is still an experimental option (for many years though) in grpc-go, so currently I do not think it is necessary to add it into lightning's config. Initializing it as maxInt would be simple and clear. |
nice insight |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, D3Hunter 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 |
[LGTM Timeline notifier]Timeline:
|
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #56114
Problem Summary: Currently, we comply with the default max-message-size=4MiB, but TiKVImporter may receive max 4k KV on each response, and each KV can be about 4KiB+, which exceeds the default limit easily.
What changed and how does it work?
Set grpc options
MaxCallRecvMsgSize
to math.MaxInt32 (2GiB), i.e., unlimited in most scenarios. This number also aligns with the default setting for MaxCallSendMsgSize in gRPC.MaxCallRecvMsgSize is only for resource control and there will not be any extra memory consumption. Please refer to the discussions below.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.