Skip to content

Add RouteEntry To TCP#10223

Closed
gargnupur wants to merge 9 commits intoenvoyproxy:masterfrom
gargnupur:nup_tcp_cluster_name
Closed

Add RouteEntry To TCP#10223
gargnupur wants to merge 9 commits intoenvoyproxy:masterfrom
gargnupur:nup_tcp_cluster_name

Conversation

@gargnupur
Copy link
Contributor

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

Add RouteEntry To TCP. This is so that we can fetch cluster_name for TCP unhealthy host connections.

Ref: istio/istio#21566

Description: Add RouteEntry To TCP
Risk Level: Low
Testing: Will Add Test
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]

@gargnupur gargnupur force-pushed the nup_tcp_cluster_name branch from 901bf67 to 27df3f7 Compare March 2, 2020 05:54
@gargnupur
Copy link
Contributor Author

@jacob-delgado, @kyessenov , @mandarjog , @douglas-reid : This is an attempt to fix istio/istio#21566
@mattklein123 , @PiotrSikora , @lizan : Does this approach look ok? It would be good to be able to get cluster name for tcp connections that are closed because upstream host is empty/unhealthy.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

At a high level I think this is an OK direction but I left some comments. Thank you!

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 mind the idea of storing a route inside the stream info, but this will need to be a shared_ptr to a const object to avoid potential lifetime issues around RDS, etc.

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 think this part makes sense, as we have tons of not implemented APIs for TCP. I would recommend introducing a common base class that might be shared between TCP and HTTP routes (and maybe other procols in the future).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think FilterChain is a more appropriate abstraction for HTTP route IMHO.

@stale
Copy link

stale bot commented Mar 11, 2020

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!

@stale stale bot added stale stalebot believes this issue/PR has not been touched recently and removed stale stalebot believes this issue/PR has not been touched recently labels Mar 11, 2020
@gargnupur gargnupur force-pushed the nup_tcp_cluster_name branch from 070ec03 to 2a01203 Compare March 12, 2020 22:50
@gargnupur gargnupur marked this pull request as ready for review March 17, 2020 14:40
Signed-off-by: gargnupur <gargnupur@google.com>

Refactor RouteEntry to use a new base class UpstreamEndpointInfo to be
shared between HTTP and TCP

Signed-off-by: gargnupur <gargnupur@google.com>

Change to use shared ptr router

Signed-off-by: gargnupur <gargnupur@google.com>

Remove upstreamendpoint info added in a separate file

Signed-off-by: gargnupur <gargnupur@google.com>

Fix lint

Signed-off-by: gargnupur <gargnupur@google.com>
@gargnupur gargnupur force-pushed the nup_tcp_cluster_name branch from b6f38ab to 1a95e49 Compare March 17, 2020 14:42
Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
@gargnupur
Copy link
Contributor Author

@mattklein123 , @lizan , @zuercher, @alyssawilk : This is ready for initial review.
Test coming up..

/cc @kyessenov , @mandarjog

Signed-off-by: gargnupur <gargnupur@google.com>
@gargnupur
Copy link
Contributor Author

gargnupur commented Mar 18, 2020

@mattklein123 , @lizan , @kyessenov , @mandarjog : I feel this PR is not worth the refactoring needed to make TCP and HTTP share UpstreamEndPointInfo(clustername, metadatamatchcriteria) in their Route classes. It would be just simpler to add cluster_name as a property in streaminfo.. created a PR for that.. #10432

Please let me know what you guys think?

Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
@kyessenov
Copy link
Contributor

@gargnupur I agree. I think adding upstream cluster info to stream info is easier and is more generally useful.


const std::string& cluster_name = route_ ? route_->clusterName() : EMPTY_STRING;
getStreamInfo().setUpstreamEndpointInfo(route_);
// getStreamInfo().setRouteEntry(std::dynamic_pointer_cast<const Router::RouteEntry>(route_));
Copy link
Contributor

Choose a reason for hiding this comment

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

Left over comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes.. will remove.. I had hoped this would work but it obviously doesn't ..
and because of which we have to add 2 new functions for UpstreamEndpointInfo..

@gargnupur
Copy link
Contributor Author

@gargnupur I agree. I think adding upstream cluster info to stream info is easier and is more generally useful.

@kyessenov : Upstream ClusterInfo is also structured for HTTP only, thus cluster_name seemed better to me..

@mattklein123
Copy link
Member

@kyessenov : Upstream ClusterInfo is also structured for HTTP only, thus cluster_name seemed better to me..

I commented in the other PR but I think we should snap the ClusterInfo shared_ptr, but let's discuss in the other PR. I'm fine with closing this one for now if we all agree on the other approach.

@gargnupur gargnupur closed this Mar 20, 2020
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.

5 participants