dns: Create new field for delayed DNS resolution#35479
dns: Create new field for delayed DNS resolution#35479keithmattix wants to merge 4 commits intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
This is the first step in providing a sort of on-demand DNS resolution for Envoy. I chose a cluster-level enum field over changes in dns_resolution configuration because the enqueueing behavior of the async DNS requests seem to be a property of the cluster and not any specific DNS resolver (e.g. c-ares). Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
d1ca53e to
915fddc
Compare
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
|
/assign @ggreenway |
|
/retest |
|
As I commented in the linked issue, it probably makes sense to make this applicable to other service discovery types as well (such as EDS). Both the behavior of not trying to fetch results until it's used, and the future mode of stopping service discovery if the cluster remains unused for a period of time. |
Hm, I understand the thrust of the idea, but IMO, DNS and xDS are different enough service discovery mechanisms to have this behavior split out. On-demand EDS is a far more invasive change IMO, but I could be wrong. EDIT Looking back at the cluster type, I would actually expect any sort of EDS config to live within eds_cluster_config |
|
I'll defer to @markdroth as the api-shepherd to review the API changes, and determine whether other discovery types should be governed by the same config or not. |
|
@markdroth friendly ping |
|
/assign-from @envoyproxy/api-shepherds |
|
@envoyproxy/api-shepherds assignee is @htuch |
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
41c62e4 to
c650a26
Compare
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
|
/retest |
markdroth
left a comment
There was a problem hiding this comment.
Sorry for not replying earlier; I've been on vacation for the last few weeks.
Please let me know if you have any questions. Thanks!
| // the DNS resolution will affect the first connection's RTT. Consequently, failure to resolve DNS before the connect timeout | ||
| // will result in a connection reset. This mode is useful for scenarios where large numbers of clusters must be sent to Envoy for config | ||
| // practicality reasons, but traffic distribution is not uniform across all clusters. | ||
| DelayedDns delayed_dns = 58; |
There was a problem hiding this comment.
Our long-term goal in xDS is to move most custom functionality like this into extension points instead of continually adding first-class fields for one-off features to the top-level API. Given that, I don't think we want to add yet another new DNS-specific field to the Cluster proto itself. Instead, I suggest taking this opportunity to move some of the cluster types into extensions. Specifically, I think we should do the following:
- Create an extension proto in extensions/clusters/ for DNS clusters. This proto should have all of the existing fields from the Cluster proto that control DNS behavior. It can also have a field to toggle between STRICT_DNS and LOGICAL_DNS behavior (or, alternatively, we could make them two different extensions, although we'd wind up duplicating a lot of the fields that way).
- Change the cluster resource validation code to automatically convert the legacy STRICT_DNS and LOGICAL_DNS enum values to the new extension.
- Add this new field in the new extension proto instead of adding it here in the Cluster proto.
There was a problem hiding this comment.
Yeah that approach sounds reasonable to me! Is there somewhere I can read about the difference between extensions vs main protos and the benefit of keeping these things in extensions?
There was a problem hiding this comment.
I don't know that we've explicitly written it down anywhere, but the main impetus is just to keep the API tractable. We can't keep adding every one-off knob that everyone wants as first-class fields, because the API will quickly become too complex for anyone to understand. Instead, we want to have a very simple overall structure with individual features in extension points, so that people that don't need a particular extension never need to see or care about the fields related to that extension.
There was a problem hiding this comment.
Ack makes perfect sense. I'll keep this PR parked and create a new one like extensions/clusters/dns.proto
|
/wait |
|
@markdroth I'm taking this issue over for @keithmattix. I'm a little confused by
My initial understanding is that I would create a But the issue that the So my question is, is my understanding correct? or is there another validation point that you are referring to? |
|
I'm not the right person to answer how this should work in terms of the Envoy implementation. From the xDS API standpoint, the intent here is that the "real" way to configure this should be via a new-style extension, and support for the old-style enum is present only for backward compatibility. The idea is that when the client sees a proto using the old-style enum, it should effectively change the received config from the old-style enum to the new style extension, and then process it as if it had actually received the new-style extension. That translation is really just there for backward compatibility, but it allows us to have only one implementation of actually supporting the functionality. I know that @wbpcode previously did something like this for moving LB policies from an enum to an extension point, so he can probably advise in terms of the best way to do this in the Envoy implementation. |
|
going to finish this in # #36353 |
|
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! |
Part of #20562
Commit Message: Create new field for on-demand DNS resolution
Additional Description: This is the first step in providing a sort of on-demand DNS resolution for Envoy. I chose a cluster-level enum field over changes in dns_resolution configuration because the enqueueing behavior of the async DNS requests seem to be a property of the cluster and not any specific DNS resolver (e.g. c-ares). In general, I'm looking to get a thumbs up on the API design before diving into the implementation.
Risk Level: Low
Testing:
Docs Changes: Should be autogenerated from the proto.
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]