-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
*: configurable gRPC message size limits #9047
Conversation
clientv3/grpc_options.go
Outdated
grpc.FailFast(true), | ||
|
||
// client-side request send limit, gRPC default is math.MaxInt32 | ||
grpc.MaxCallSendMsgSize(math.MaxInt32), |
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.
what is the sever side recv default limit? the send limit should be smaller than server side recv default limit.
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.
Server-side default send maxSendBytes
is math.MaxInt32
.
Server-side default receive embed.DefaultMaxRequestBytes
is 1.5MB.
For now, it seems easier to configure client-side parameters unlimited.
This is very easy to mis-configure.
For example, user A configures 5MB server-side request limit and 4.5MB client-side send limit, but forgot to configure client-side receive limit (thus defaults to 4MB). Then, 4.2MB write requests would still succeed, while receive requests fail.
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.
the goal of the default value is to prevent users to shoot in foot. I do not think we should expect users to send out a request that is > 4MB.
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.
@xiang90 Agree. But, kubernetes/kubernetes#51099 is sending 26MB :0
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.
FWIW, The current rule of thumb for kubernetes is to limit all objects stored in etcd to under 1MB. So I'd expect sends to be in that range. Receives can be range reads, which can get pretty huge for things like event-exporter
(kubernetes/kubernetes#51099) that literally dumps out the entire etcd events keyspace.
clientv3/grpc_options.go
Outdated
grpc.MaxCallSendMsgSize(math.MaxInt32), | ||
|
||
// client-side request receive limit, gRPC default is 4MB | ||
// (must be consistent with server-side max request limit) |
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.
client side recv limit should >= server side send max request limit
defer to @jpbetz |
Is it sending 26MB or receiving? If it is sending 26MB, the request will fail regardless. etcd server wont accept put that is larger than 1.5MB. |
d9951e3
to
6994373
Compare
@xiang90 The error in kubernetes/kubernetes#51099 is in the receiving. And since it happened with etcd client Get request, I assumed that 26MB writes were done via etcd client Puts as well. But not sure how such large value was written in the first place. /cc @jpbetz
Expose both client-side recv and send limits to |
Not really. Users can write 1000 small values and do a range to get them
all. That is why we should limit the send value from client not the receive
value.
…On Tue, Dec 19, 2017 at 3:52 PM Gyuho Lee ***@***.***> wrote:
@xiang90 <https://github.com/xiang90> The error in
kubernetes/kubernetes#51099
<kubernetes/kubernetes#51099> is in the
receiving. And since it happened with etcd client Get request, I assumed
that 26MB writes were done via etcd client Puts as well. But not sure how
such large value was written in the first place. /cc @jpbetz
<https://github.com/jpbetz>
client-side send limit < server-side recv default limit
client-side recv limit >= server-side send limit
Expose both client-side recv and send limits to clientv3.Config?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9047 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AERby40bXikj8QSp-AbHIXpyTAWr2MKTks5tCEwxgaJpZM4RHsZi>
.
|
@xiang90 You are right. Let me address that shortly. |
393ad56
to
e19e863
Compare
2cf2808
to
31242cd
Compare
Codecov Report
@@ Coverage Diff @@
## master #9047 +/- ##
=========================================
Coverage ? 76.11%
=========================================
Files ? 359
Lines ? 29943
Branches ? 0
=========================================
Hits ? 22792
Misses ? 5575
Partials ? 1576
Continue to review full report at Codecov.
|
31242cd
to
cfcf65f
Compare
clientv3/grpc_options.go
Outdated
// Make sure that "client-side send limit < server-side default send/recv limit" | ||
// This is the same value as "embed.DefaultMaxRequestBytes" but not including | ||
// gRPC overhead bytes; a bit smaller than server-side default send/recv limit. | ||
defaultMaxCallSendMsgSize = grpc.MaxCallSendMsgSize(1.5 * 1024 * 1024) |
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.
probably bump to 2 to leave some space?
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.
Sounds good. Will change it to 2 MiB.
cfcf65f
to
1aef249
Compare
The last commit addresses some flakiness in 32-bits--wait leader was taking longer than it should with 100ms context timeout. Increased the timeout to >1-second. Turns out this reduces test runtime by 1~2 minutes (semaphore 32- and 64-bit test suites). For kubernetes/kubernetes#51099, etcd clientv3 must be upgraded to v3.2.12 (to be released soon), and v3.2.11 without this patch defaults its receive limit to 4MiB in client-side. So, range response with 27MiB fails. Will only backport clientv3 changes to v3.2.12 (hopefully today). CHANGELOG is already updated to highlight this change (#8979). |
Thanks for the comprehensive docs, I just read through them and they made sense to me. Reviewing code now. |
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Make headers consistent. Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
Signed-off-by: Gyuho Lee <[email protected]>
1aef249
to
ac9d22e
Compare
Signed-off-by: Gyuho Lee <[email protected]>
ac9d22e
to
3c5eb4f
Compare
@jpbetz Feedback all addressed. PTAL. Will release v3.2.12 and v3.3.0-rc.0 with this by today afternoon. Thanks! |
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
Thanks @gyuho!!
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply #57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix #51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ```
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Version bump to etcd v3.2.13, grpc v1.7.5 Reapply kubernetes/kubernetes#57160 but with etcd 3.2.13, which includes etcd-io/etcd#9047 to fix kubernetes/kubernetes#51099. We need to scalability test this PR before merging it since the previous attempt to version bump to grpc v1.7+ resulted in a scalability test failure after the PR was merged to master, and we don't want to repeat that. No, no we don't. Thanks @gyuho for fixing the etcd grpc issue and releasing etcd-3.2.13 on short notice. **Release note**: ```release-note Upgrade to etcd client 3.2.13 and grpc 1.7.5 to improve HA etcd cluster stability. ``` Kubernetes-commit: 531b97ba93e46cde4b1fcd3f170224dbecbe2c1d
Fix #9043.
/cc @jpbetz @xiang90