Skip to content

Added VHDS protobuf message and updated RouteConfig to include it.#6418

Merged
htuch merged 1 commit intoenvoyproxy:masterfrom
dmitri-d:vhds-proto
Apr 3, 2019
Merged

Added VHDS protobuf message and updated RouteConfig to include it.#6418
htuch merged 1 commit intoenvoyproxy:masterfrom
dmitri-d:vhds-proto

Conversation

@dmitri-d
Copy link
Contributor

Signed-off-by: Dmitri Dolguikh ddolguik@redhat.com

For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md

Description:
Risk Level: low
Testing:
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

@dmitri-d
Copy link
Contributor Author

@htuch: This is VHDS protocol related changes. I'm thinking that DeltaRequest/Response nonce use warrants a dedicated PR, when we get there?

@dmitri-d
Copy link
Contributor Author

@dmitri-d
Copy link
Contributor Author

  • reverted [(gogoproto.nullable) = false] on RouteConfiguration.virtual_hosts, as vhds field is marked as #not-implemented-hide:

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Great, this is nice self-contained PR.

/wait

Copy link
Member

Choose a reason for hiding this comment

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

Can you describe the intended final merge semantics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Copy link
Member

Choose a reason for hiding this comment

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

Smallest nit in the world: the last sentence is missing a period at the end.

Copy link
Member

Choose a reason for hiding this comment

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

Only one protodoc-title per .proto :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

Copy link
Member

Choose a reason for hiding this comment

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

Can you provide some discussion comparable to that for RouteDiscoveryService. In particular, should cover what the resource type is embedded in Any and how this related to RDS and expected use cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

You need to fix the Bazel target deps to include config_source to fix the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

Choose a reason for hiding this comment

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

Is it better to say

RDS updates related to the newly added listeners must arrive after CDS/EDS/LDS updates
VHDS updates (if any) related to the newly added Route Configurations must arrive after RDS updates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That sounds better I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Member

Choose a reason for hiding this comment

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

I think this should be nullable. If VHDS is enabled, it makes sense for virtual host updates to come over VHDS while route configs (minus virtual hosts) come across RDS.

Copy link
Member

Choose a reason for hiding this comment

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

Should drop the semicoolon after virtual_hosts =2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, removed that.

@brian-avery
Copy link
Member

LGTM

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Looks good, just a bunch of nits around formatting and a few comments requests, thanks.

/wait

Copy link
Member

Choose a reason for hiding this comment

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

Nit: prefer RouteConfigurations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Nit: RouteConfiguration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the reference

Copy link
Member

Choose a reason for hiding this comment

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

Nit: the preferred RST formatting for literals such as header name is something like *host*

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

*resource_names_subscribe* (or do a :ref: link to the field name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

I think we need 1-2 sentences explaining what a VHDS is and why you need one :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a short explanation

Copy link
Member

Choose a reason for hiding this comment

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

Nit * syntax or :ref: for these field names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

, with *vhds* derived configuration taking precedence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added

@htuch
Copy link
Member

htuch commented Apr 2, 2019

Also, needs DCO/format fixes.

@dmitri-d
Copy link
Contributor Author

dmitri-d commented Apr 2, 2019

  • also restored [(gogoproto.nullable) = false] on RouteConfiguration.virtual_hosts: an empty array should be used in favour of a null field.

@dmitri-d
Copy link
Contributor Author

dmitri-d commented Apr 2, 2019

  • fixed formatting/spelling and DCO errors.

@dmitri-d
Copy link
Contributor Author

dmitri-d commented Apr 2, 2019

@htuch: I'll squash the commits once you are happy with the PR, I thought keeping them as is might help during the review.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

I think last few comments and we're good to go, thanks.
/wait

Copy link
Member

Choose a reason for hiding this comment

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

Smallest nit in the world: the last sentence is missing a period at the end.

Copy link
Member

Choose a reason for hiding this comment

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

You can drop this line entirely actually, the entry above is actually file-wide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

This message should be // [#not-implemented-hide:]; it's visible at the CI generated docs https://192807-65214191-gh.circle-artifacts.com/0/source/generated/docs/api-v2/api/v2/rds.proto.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

"during the processing of an HTTP request if..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Nit: you can actually link directly to fields, grep for envoy_api_field_ to see how.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@dmitri-d
Copy link
Contributor Author

dmitri-d commented Apr 2, 2019

  • fixes based on the feedback

@htuch
Copy link
Member

htuch commented Apr 3, 2019

@dmitri-d LGTM, can you fix format and I can merge? DCO seems to be green. Thanks.

@htuch htuch added the waiting label Apr 3, 2019
Signed-off-by: Dmitri Dolguikh <ddolguik@redhat.com>
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Apr 3, 2019

  • fixed formatting
  • squashed commits

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

Thanks!

@htuch htuch merged commit a781218 into envoyproxy:master Apr 3, 2019
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Apr 3, 2019

Thanks for the reviews, @htuch!

// [#comment:next free field: 9]
// Virtual Host Discovery Service (VHDS) is used to dynamically update the list of virtual hosts for
// a given RouteConfiguration. If VHDS is configured a virtual host list update will be triggerred
// during the processing of an HTTP request if a route for the request cannot be resolved. The
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually true? Do we plan on pausing request processing and making a VHDS request? IMO this should probably be done as a separate filter if we want behavior. cc @htuch @dmitri-d

Copy link
Member

Choose a reason for hiding this comment

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

@mattklein123 how would this work as an HTTP filter? Don't we need an initial route/cluster pick before we start down the HTTP filter chain? I think we were thinking of augmenting HCM to handle this.

Copy link
Member

Choose a reason for hiding this comment

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

No, we still iterate all filters even if there is no route, so we can have an optional filter which pauses and fetches a new VHDS entry if users want that functionality vs. just standard eventually consistent VHDS. I would argue this is a cleaner design.

Copy link
Member

Choose a reason for hiding this comment

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

@mattklein123 yeah, it is arguably much cleaner. What to do about things that are done by HCM in decodeHeaders before filter execution though, e.g.

if (cached_route_.value()) {
? Ideally, VHDS should be as expressive and capable as regular RouteConfiguration.

Copy link
Member

Choose a reason for hiding this comment

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

I don't have all the answers right now, but I think this code should be moved into the route refresh code anyway, since arguably the timeout should be changed if the route changes. This would then "just work" on the on-demand VHDS filter. I'm pretty sure we can make this work cleanly as a filter.

Copy link
Member

Choose a reason for hiding this comment

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

That sounds good. So, there will need to be some HCM changes, but we'll push most of the logic into a filter. @dmitri-d WDYT?

Copy link
Contributor Author

@dmitri-d dmitri-d Apr 4, 2019

Choose a reason for hiding this comment

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

That's pretty close to the WIP implementation (see https://github.com/envoyproxy/envoy/pull/6406/files#diff-be24bc0fe90bba5c4e871fb56928e085R12). An (the main?) issue with moving code into refreshCachedRoute is probably going to be here:

const bool upgrade_rejected = createFilterChain() == false;
. It relies on a routing table being present to build a filter chain. I need to think what can be done about that.

Copy link
Member

Choose a reason for hiding this comment

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

cc @alyssawilk for comment. I think we might be able to handle this via an internal redirect from the filter if we can't figure out a more elegant solution during route cache reload.

mpuncel added a commit to mpuncel/envoy that referenced this pull request Apr 8, 2019
* master: (137 commits)
  test: router upstream log to v2 config stubs (envoyproxy#6499)
  remove idle timeout validation (envoyproxy#6500)
  build: Change namespace of chromium_url. (envoyproxy#6506)
  coverage: exclude chromium_url (envoyproxy#6498)
  fix(tracing): allow 256 chars in path tag (envoyproxy#6492)
  Common: Introduce StopAllIteration filter status for decoding and encoding filters (envoyproxy#5954)
  build: update PGV url (envoyproxy#6495)
  subset lb: avoid partitioning host lists on worker threads (envoyproxy#6302)
  ci: Make envoy_select_quiche no-op. (envoyproxy#6393)
  watcher: notify when watched files are modified (envoyproxy#6215)
  stat: Add counterFromStatName(), gaugeFromStatName(), and histogramFromStatName() (envoyproxy#6475)
  bump to 1.11.0-dev (envoyproxy#6490)
  release: bump to 1.10.0 (envoyproxy#6489)
  hcm: path normalization. (#1)
  build: import manually minified Chrome URL lib. (envoyproxy#3)
  codec: reject embedded NUL in headers. (envoyproxy#2)
  Added veryfication if path contains query params and add them to path header (envoyproxy#6466)
  redis: basic integration test for redis_proxy (envoyproxy#6450)
  stats: report sample count as an integer to prevent loss of precision (envoyproxy#6274)
  Added VHDS protobuf message and updated RouteConfig to include it. (envoyproxy#6418)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.com>
@dmitri-d dmitri-d deleted the vhds-proto branch May 20, 2020 19:45
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.

4 participants