cache: fix cache proto's max_body_bytes type #12273
cache: fix cache proto's max_body_bytes type #12273enozcan wants to merge 7 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
|
You can regenerate the shadow API files by running |
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
|
Sorry, we've been having some CI issues lately. Can you try a master merge to see if it sorts out CI unhappiness? |
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
| // Max body size the cache filter will insert into a cache. 0 means unlimited (though the cache | ||
| // storage implementation may have its own limit beyond which it will reject insertions). | ||
| uint32 max_body_bytes = 4; | ||
| uint64 max_body_bytes = 4; |
There was a problem hiding this comment.
you can't change the v2 protos now.
| // Max body size the cache filter will insert into a cache. 0 means unlimited (though the cache | ||
| // storage implementation may have its own limit beyond which it will reject insertions). | ||
| uint32 max_body_bytes = 4; | ||
| uint64 max_body_bytes = 4; |
There was a problem hiding this comment.
I'm wondering if we need to deprecate this field and make a new one with the different type. @htuch ?
There was a problem hiding this comment.
I think the question is do we realistically expect to have cache objects > 4GB? If yes, then let's do this new/old deprecation dance, otherwise let's handle the type mismatch in the implementation.
There was a problem hiding this comment.
@toddmgreer Should we commit to 4G limit in cacheable object sizes? Seems OK to me.
Maybe in practicality, as there are no real impls of this filter yet, it doesn't matter if we change the type as there's no outstanding data to be compatible with.
There was a problem hiding this comment.
I don't know why anyone would want to set a size limit that's higher than 4G, but I have no objection to allowing it. I also have no objection to leaving it as is.
|
int32, uint32, int64, uint64, and bool are all compatible – this means
you can change a field from one of these types to another without breaking
forwards- or backwards-compatibility. If a number is parsed from the wire
which doesn't fit in the corresponding type, you will get the same effect
as if you had cast the number to that type in C++ (e.g. if a 64-bit number
is read as an int32, it will be truncated to 32 bits).
I think the question is thus whether anyone will send a v3+ configuration
with max_body_bytes > 4GB to a deployment that expects a v2 configuration.
There aren't any deployments of this alpha filter, so that isn't going to
happen.
…On Mon, Aug 17, 2020 at 5:51 PM htuch ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In api/envoy/extensions/filters/http/cache/v3alpha/cache.proto
<#12273 (comment)>:
> @@ -80,5 +80,5 @@ message CacheConfig {
//
// Max body size the cache filter will insert into a cache. 0 means unlimited (though the cache
// storage implementation may have its own limit beyond which it will reject insertions).
- uint32 max_body_bytes = 4;
+ uint64 max_body_bytes = 4;
I think the question is do we realistically expect to have cache objects >
4GB? If yes, then let's do this new/old deprecation dance, otherwise let's
handle the type mismatch in the implementation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRAWPK5POIU2JHGVZNSZVDSBHGAHANCNFSM4PGTSN2Q>
.
|
Not passing CI, as you can't change v2 anymore.
|
We're actually stricter than wire compatibility and need to ensure we don't break language bindings as well, see https://github.com/envoyproxy/envoy/blob/master/api/API_VERSIONING.md#backwards-compatibility. |
|
It says "Fields should not be renumbered or have their types changed. This
is standard proto development procedure." However, this kind of type change
(uint32->uint64) is perfectly fine in standard proto development procedure.
I think the rule is overly conservative, and that this change doesn't break
language bindings. Specifically, I think widening should be allowed.
…On Tue, Aug 18, 2020 at 11:00 AM htuch ***@***.***> wrote:
We're actually stricter than wire compatibility and need to ensure we
don't break language bindings as well, see
https://github.com/envoyproxy/envoy/blob/master/api/API_VERSIONING.md#backwards-compatibility
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12273 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRAWPIDXIVXCPDY6QJGJMLSBK6UXANCNFSM4PGTSN2Q>
.
|
|
Possibly, @envoyproxy/api-shepherds WDYT? I'd ask for you to update the style guide at the same time if we do this. |
|
Fine with me! |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
Signed-off-by: Enes Ozcan <enes.ozcan@hazelcast.com>
|
@jmarantz Reverted v2 protos and I wonder if there should be any further changes - docs, deprecations, etc. regarding the conversations above. |
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
jmarantz
left a comment
There was a problem hiding this comment.
I lost track of this PRl. Is this still active?
| // Max body size the cache filter will insert into a cache. 0 means unlimited (though the cache | ||
| // storage implementation may have its own limit beyond which it will reject insertions). | ||
| uint32 max_body_bytes = 4; | ||
| uint64 max_body_bytes = 4; |
There was a problem hiding this comment.
@toddmgreer Should we commit to 4G limit in cacheable object sizes? Seems OK to me.
Maybe in practicality, as there are no real impls of this filter yet, it doesn't matter if we change the type as there's no outstanding data to be compatible with.
|
/wait |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Commit Message: Change max_body_bytes type in cache.proto to uint64.
Additional Description: uint64_t is used for response body sizes in cache filter (
AdjustedByteRange,LookupResult::content_length_etc.) where max_body_bytes field is uint32 in cache.proto. Related discussion with @toddmgreer : #10536 (comment)I also wonder how to change (or generate) these fields under
generated_api_shadowas it says:Do not hand edit any file under envoy/and as I see they are not generated after build.Risk Level: No usage of this field exists.
Testing: N/A
Docs Changes: N/A
Release Notes: N/A