Skip to content

dns: renumber dns filter fields for wire compatibility - #17943

Merged
mattklein123 merged 6 commits into
envoyproxy:mainfrom
jpeach:reserve-dns-filter-fields
Sep 7, 2021
Merged

mattklein123 merged 6 commits into
envoyproxy:mainfrom
jpeach:reserve-dns-filter-fields

Conversation

@jpeach

@jpeach jpeach commented Sep 1, 2021

Copy link
Copy Markdown
Contributor

Commit Message:

Field 2 in the DnsFilterConfig message was released in Envoy 1.18,
and repurposed in Envoy 1.19. Renumber the field, while leaving a
compatibility field so that control planes can gracefully migrate to a
subsequent 1.19 release.

Risk Level: Medium
Testing: CI
Docs Changes: None
Release Notes: Probably needs something. I can come up with some text after there's consensus on the change.
Platform Specific Features:
Fixes: #17921

Field 2 in the `DnsFilterConfig` message was released in Envoy 1.18,
and repurposed in Envoy 1.19. Renumber the field, while leaving a
compatibility field so that control planes can gracefully migrate to a
subsequent 1.19 release.

This fixes #17921.

Signed-off-by: James Peach <[email protected]>
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #17943 was opened by jpeach.

see: more, trace.

Signed-off-by: James Peach <[email protected]>
@jpeach

jpeach commented Sep 1, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #17943 (comment) was created by @jpeach.

see: more, trace.

// clients, and set `dns_resolution_config` instead for later Envoy clients.
// Control planes that need to simultaneously support Envoy 1.18 should
// avoid Envoy 1.19.0 and 1.19.1.
config.core.v3.DnsResolutionConfig compat_dns_resolution_config = 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please provide a little bit more details about how this new field will be used?

From this code, only dns_resolution_config field is used.

if (client_config.has_dns_resolution_config()) {

To my understanding, dns_resolution_config is used by cares DNS resolver to resolve targets. Do you mean adding a new field(with identical type) here for same purpose, but for different version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referring this comment: #17921 (comment)

we need a proto definition where field 2 isn't used for 2 different purposes.

So shouldn't this field actually be of type Address? Correct me if I am wrong here.

repeated config.core.v3.Address upstream_resolvers = 2; code link

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, migrating from 1.18, Address would be ideal. However 1.19 already shipped with the DNS config in field 2, so applications that support 1.19.0 will also need to migrate. It's a matter of who takes the burden of having to fork the protobufs to get the type they need in the right field.

If we have consensus that field 2 should be of type Address, that's great for me because it's a lot less work :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you make a good point. I ought to err on making it easier for myself, at least until Envoy API reviewers give their feedback :)

Updated the PR with Address.

@suniltheta suniltheta Sep 2, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking about the other alternates, can we have v3alpha and v3 support simultaneously? Extrapolating from this comment by Matt, assuming this is what was mean from the comment.

The Control plane would support both the versions v3alpha & v3 for DnsFilter. DnsFilter v3alpha support for v1.18 envoy (and prior to v1.18) & DnsFilter v3 support for v1.19.2 and future releases (v1.20+).

This way the envoys currently using DnsFilter can migrate from 1.18 to strictly 1.19.2+

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need a single Envoy release to simultaneously support multiple versions of the dns filter. I just need the protobufs to be defined in such a way that I can serve both 1.18 and 1.19 Envoy clients.

So rather than changing v3alpha definitions, Envoy 1.19 could have frozen the v3alpha protobufs and moved the implementation to v3alpha1. Then I could have served v3alpha to Envoy 1.18 and v3alpha1 to Envoy 1.19. But right now, this PR is just trying to find the least worst way to recover.

Switch the definition of DnsFilterConfig field 2 back to the Envoy 1.18
type. This helps 1.18 control planes at the expense of 1.19.0 and 1.19.1
control planes.

Signed-off-by: James Peach <[email protected]>
@mattklein123 mattklein123 self-assigned this Sep 2, 2021
@mattklein123

Copy link
Copy Markdown
Member

If this will solve your problem I'm OK with this approach.

FYI that after this lands I'm going to be moving this proto to non-alpha.

// clients should fork the protobufs and change this field to type
// `DnsResolutionConfig`.
// Control planes that need to simultaneously support Envoy 1.18 should
// avoid Envoy 1.19.0 and 1.19.1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add // [#not-implemented-hide:] here if this PR will contain only the API changes?

Or we could probably bring back the code to support this deprecated config (upstream_resolvers) on this PR. (Preferable since all the changes will be intact)

@jpeach jpeach Sep 3, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the comment is a good idea, fixing that. I don't need the implementation, I can just populate the right fields for the right envoy version.

Signed-off-by: James Peach <[email protected]>
@jpeach

jpeach commented Sep 3, 2021 •

Copy link
Copy Markdown
Contributor Author

If this will solve your problem I'm OK with this approach.

FYI that after this lands I'm going to be moving this proto to non-alpha.

Cool, thanks @mattklein123.

Just to be clear to everyone what the changes here are:

Control planes can use this protobuf definition to migrate from Envoy 1.18.4 to 1.19.2 (once I PR a backport). Control planes that need to migrate from Envoy 1.19.{0,1} to 1.19.2 will have to fork the protobufs to change the type of field 2.

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Can you add a release note either under deprecations, breaking changes, or somewhere else that explains this? After this lands I'm going to force migrate this proto to non-alpha.

/wait

Signed-off-by: James Peach <[email protected]>
@jpeach

jpeach commented Sep 6, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #17943 (comment) was created by @jpeach.

see: more, trace.

@jpeach

jpeach commented Sep 6, 2021

Copy link
Copy Markdown
Contributor Author

Thanks. Can you add a release note either under deprecations, breaking changes, or somewhere else that explains this?

I added a note to the release notes, LMK if you feel this needs a more detailed explanation.

@mattklein123

Copy link
Copy Markdown
Member

I added a note to the release notes, LMK if you feel this needs a more detailed explanation.

TBH I would appreciate one. The solution seems pretty involved and you might as well spell it out? Thank you.

/wait

Signed-off-by: James Peach <[email protected]>
@jpeach

jpeach commented Sep 7, 2021

Copy link
Copy Markdown
Contributor Author

I added a note to the release notes, LMK if you feel this needs a more detailed explanation.

TBH I would appreciate one. The solution seems pretty involved and you might as well spell it out? Thank you.

/wait

Screenshot from 2021-09-07 11-35-43

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@repokitteh-read-only repokitteh-read-only Bot removed the api label Sep 7, 2021
@mattklein123
mattklein123 merged commit ff9704e into envoyproxy:main Sep 7, 2021
@yanjunxiang-google

yanjunxiang-google commented Sep 14, 2021 via email

Copy link
Copy Markdown
Contributor

@jpeach

jpeach commented Sep 14, 2021

Copy link
Copy Markdown
Contributor Author

I have a question about the dns_resolution_config field in dns_filter.proto. With #17479/, we are supporting the new typed_dns_resolver_config, which is to replace this dns_resolution_config. IIUC, we don't have to consider API backward compatibility for dns_resolution_config field since it looks like no one used it yet (otherwise we can not renumber it as in #17943). If that's the case, can we just remove dns_resolution_config field from dns_filter.proto after with/after #17479 committed? thanks, Yanjun

The protobuf definitions for dns_resolution_config are in go-control-plane and the implementation shipped in Envoy 1.19. If you remove the field from the protobuf, then that change will get picked up in go-control-plane and projects that consume those protobufs will no longer be able to send dns_resolution_config to Envoy 1.19.

@jpeach
jpeach deleted the reserve-dns-filter-fields branch September 14, 2021 22:18
tyxia pushed a commit to tyxia/envoy that referenced this pull request Sep 21, 2021
)

Field 2 in the `DnsFilterConfig` message was released in Envoy 1.18,
and repurposed in Envoy 1.19. Renumber the field, while leaving a
compatibility field so that control planes can gracefully migrate to a
subsequent 1.19 release.

This fixes envoyproxy#17921.

Signed-off-by: James Peach <[email protected]>
mathetake pushed a commit that referenced this pull request Oct 21, 2021
Field 2 in the `DnsFilterConfig` message was released in Envoy 1.18,
and repurposed in Envoy 1.19. Renumber the field, while leaving a
compatibility field so that control planes can gracefully migrate to a
subsequent 1.19 release.

This fixes #17921.

Signed-off-by: James Peach <[email protected]>
(cherry picked from commit ff9704e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DNS filter protobuf incompatibility between Envoy 1.18 and 1.19

5 participants