-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Allow http route and cluster metadata to contain typed metadata in An… #16107
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
Changes from 2 commits
7a11210
c997e15
6276b4d
2ab8508
82d73eb
009ede2
1673473
97986c0
8936371
6d62272
b48a943
91e31bc
c5254db
03500dc
c21cb0b
4042f5d
7b22234
9d8d04f
e59b4c4
d2b51da
4767834
33bb388
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Please add some comments here.
You might also want to update the comment for the
Metadatamessage to describe the differences between the typed and non-typed filter metadata fields.In addition, can the same key be in both
filter_metadataandtyped_filter_metadata. If so, what happens in this case?BTW: if there should only be either
filter_metadataortyped_filter_metadatabut not both, then consider usingoneofhere.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 question here is shall we deprecate
filter_metadata? When we changed filter configs from Struct to Any we deprecated Struct because Any can have Struct in it.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.
let's mark it as deprecated.
I think Oneof will make it harder to migrate.
For now we need both to have a smooth migration: let the metadata impl first look at typed_filter_metadata and fallback to typed_metadata when it's not populated. This way we can decouple dataplane with control plane.
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.
Yeah don't make it oneof, it breaks the compatibility on generated codes and violates our API policy.
Uh oh!
There was an error while loading. Please reload this page.
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.
Using Oneof is infeasible here. For Oneof fields, "You can add fields of any type, except map fields and repeated fields." See https://developers.google.com/protocol-buffers/docs/proto3#oneof
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 main present issue with transitioning to using
Struct-inside-of-Anyis that the Metadata utility class has static methods only. It will be inefficient to use with theStruct-inside-of-Anyas there is no way to cache parsed Struct. The Metadata utility class is used heavily within Envoy and also by proprietary filters, so changing its API will be challenging.One potential way forward is to make current implementation of the Metadata class inefficient with respect to
Struct-inside-of-Anyand mark it as deprecated to prevent further use. And then add a new class that can cache parsed Struct from Any.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.
Yeah, I think a
TypedMetadataclass would make sense.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.
Thanks for the comments. Based on the discussion, I put Struct as deprecated, and added Any. Please take a look the latest code change and let me know whether this look good to you.
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.
With Struct field being deprecated, this pre_submit check scripts: " ci/run_envoy_docker.sh 'ci/do_ci.sh bazel.compile_time_options' ", is complaining below and failed the check constantly:
2021-05-07T23:34:58.2181735Z C++ exception with description "type envoy.config.core.v3.Metadata Using deprecated option 'envoy.config.core.v3.Metadata.filter_metadata' from file base.proto. This configuration will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/version_history/version_history for details. If continued use of this field is absolutely necessary, see https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features for how to apply a temporary and highly discouraged override." thrown in the test body.
2021-05-07T23:34:58.2184225Z [ FAILED ] OmitHostsRetryPredicateTest.PredicateTest (22 ms)
This happend on a lot of test cases, and one scripts run only report some of them. Once some test cases are failed as above, I just use DEPRECATED_FEATURE_TEST() to guard them. Another scripts run will report new ones. I have below questions:
Please let me know your opinion.
Thanks!
Uh oh!
There was an error while loading. Please reload this page.
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.
There are a lot of test cases broken by deprecating Struct field. Fixing those test cases need time. Given the timing pressure for adding Any support in this protobuf, we decided to tackle Struct field deprecation and fixing the related test cases in a separate PR.
Please let me know whether this sound good to you.