Repository navigation
DFP: Track connections in the DFP LoadBalancer - #17874
Conversation
a load balancer to optionally observe connection lifetime events and to select a specific connection based on those events. Implement this behavior in the DFP LoadBalancer to reuse HTTP/2 and HTTP/3 onnections when the hash key, IP address, and certificate all match. Signed-off-by: Ryan Hamilton <[email protected]>
|
This is the first chunk of the work described in https://docs.google.com/document/d/1QbBWrchUlStu5GAUd_Tz9CinIzCsUDlnJNgOMGpScLE/edit# |
|
/assign @RenjieTang |
RenjieTang
left a comment
There was a problem hiding this comment.
Looking great! Minor question.
Also I can't access the design doc you provided.
RyanTheOptimist
left a comment
There was a problem hiding this comment.
Sorry about the doc permissions. You should have access now.
snowp
left a comment
There was a problem hiding this comment.
This seems really cool, thanks for working on it! Some comments to get this started
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
RyanTheOptimist
left a comment
There was a problem hiding this comment.
Thanks for the thoughtful comments!
| } | ||
|
|
||
| absl::optional<Upstream::SelectedPoolAndConnection> | ||
| Cluster::LoadBalancer::selectPool(Upstream::LoadBalancerContext* context, |
There was a problem hiding this comment.
Naming is hard! Thanks for thinking through this! I like the idea of adding "Existing" to the name (since that would help clarify the semantics). How about selectExistingConnection? (Since it selects a connection within a pool). I've not changed the name in the PR, but once we agree I will.
| // the TLS certificate is also valid for the new hostname. For example, if a connection | ||
| // has previously been established to foo.example.com at IP 1.2.3.4 with a certificate | ||
| // that is valid for *.example.com, then this connection could be used for requests to | ||
| // bar.example.com if that also resolved to 1.2.3.4. |
There was a problem hiding this comment.
This is legit from RFC point of view but it's not how envoy likes.
The idea is bar.example.com is valid for ".example.com" but it might not the upstream envoy wants.
Envoy may don't like "bar.example.com" even if the cert accept ".example.com"
See #6767 (comment)
-
Can you add the the risk that when not to use
allow_coalesced_connections? Otherwise, I would no brain turn on it when read your description. -
It seems the implementation applies to forward proxy cluster but it's not clear in the doc here.
There was a problem hiding this comment.
- Hm, this sounds like a good idea. I'm not quite sure how to phrase this though. I've taken a stab. Please take a look!
- I'm not sure I understand. This is the doc for the forward cluster so I would have expected that it would be clear that the config described here is only for the cluster. Can you suggest some text to add to make this more clear?
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
htuch
left a comment
There was a problem hiding this comment.
API looks good, but would like to clarify doc nit and needs version history entry.
/wait
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
|
Seems like coverage is still failing, can you take a look? /wait |
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
Signed-off-by: Ryan Hamilton <[email protected]>
|
@alyssawilk this has FINALLY cleared CI and is hopefully ready for your review. |
|
I don't think I'm assigned to this one. If you want me to be, you can now assign me using the UI and not /assign otherwise @snowp can do a pass :-) |
Oh. My unfamiliarity with GitHub strikes again. You're listed in the "Reviewers" section at the top but that's not the same as being Assigned. Gotcha! In that case, I'm happy to defer to @snowp! |
@snowp friendly ping |
I think this is all resolved now. @htuch can you take another look from an API perspective? |
…43702) ## Commit Message http: wire ConnectionLifetimeCallbacks into pool connection events ## Description Wires up the `ConnectionLifetimeCallbacks` interface that is there but is not connected to actual connection events from what I see at least. The cluster manager now passes the LB's callbacks into each HTTP pool at creation time, and `MultiplexedActiveClientBase` fires them on Connected, Close, and GOAWAY events. Primary motivation: allows the reverse tunnel cluster's LB to detect GOAWAY and report it to the tunnel reporter ([raw example](aakugan@31094c9)). Also applicable to DFP clusters for connection coalescing awareness from what I [see](#17874). ## Risk Level Should be low. Additive-only changes to production code. Callbacks are no-ops unless explicitly set by the LB. No behavior change for existing clusters. ## Testing - HTTP/2 conn pool unit tests (7 tests): no-op without callbacks, Connected/RemoteClose/LocalClose with arg verification, GOAWAY with active streams, idle GOAWAY, callback replacement. - HTTP/3 conn pool unit test: Connected + idle GOAWAY through `MultiplexedActiveClientBase`. - Cluster manager unit tests: verifies `setLifetimeCallbacks` is called on pool creation. ## Docs Changes N/A ## Release Notes N/A --------- Signed-off-by: aakugan <[email protected]>
…nvoyproxy#43702) ## Commit Message http: wire ConnectionLifetimeCallbacks into pool connection events ## Description Wires up the `ConnectionLifetimeCallbacks` interface that is there but is not connected to actual connection events from what I see at least. The cluster manager now passes the LB's callbacks into each HTTP pool at creation time, and `MultiplexedActiveClientBase` fires them on Connected, Close, and GOAWAY events. Primary motivation: allows the reverse tunnel cluster's LB to detect GOAWAY and report it to the tunnel reporter ([raw example](aakugan@31094c9)). Also applicable to DFP clusters for connection coalescing awareness from what I [see](envoyproxy#17874). ## Risk Level Should be low. Additive-only changes to production code. Callbacks are no-ops unless explicitly set by the LB. No behavior change for existing clusters. ## Testing - HTTP/2 conn pool unit tests (7 tests): no-op without callbacks, Connected/RemoteClose/LocalClose with arg verification, GOAWAY with active streams, idle GOAWAY, callback replacement. - HTTP/3 conn pool unit test: Connected + idle GOAWAY through `MultiplexedActiveClientBase`. - Cluster manager unit tests: verifies `setLifetimeCallbacks` is called on pool creation. ## Docs Changes N/A ## Release Notes N/A --------- Signed-off-by: aakugan <[email protected]> Co-authored-by: mmorel-35 <[email protected]>
…nvoyproxy#43702) ## Commit Message http: wire ConnectionLifetimeCallbacks into pool connection events ## Description Wires up the `ConnectionLifetimeCallbacks` interface that is there but is not connected to actual connection events from what I see at least. The cluster manager now passes the LB's callbacks into each HTTP pool at creation time, and `MultiplexedActiveClientBase` fires them on Connected, Close, and GOAWAY events. Primary motivation: allows the reverse tunnel cluster's LB to detect GOAWAY and report it to the tunnel reporter ([raw example](aakugan@31094c9)). Also applicable to DFP clusters for connection coalescing awareness from what I [see](envoyproxy#17874). ## Risk Level Should be low. Additive-only changes to production code. Callbacks are no-ops unless explicitly set by the LB. No behavior change for existing clusters. ## Testing - HTTP/2 conn pool unit tests (7 tests): no-op without callbacks, Connected/RemoteClose/LocalClose with arg verification, GOAWAY with active streams, idle GOAWAY, callback replacement. - HTTP/3 conn pool unit test: Connected + idle GOAWAY through `MultiplexedActiveClientBase`. - Cluster manager unit tests: verifies `setLifetimeCallbacks` is called on pool creation. ## Docs Changes N/A ## Release Notes N/A --------- Signed-off-by: aakugan <[email protected]>
Widen the Upstream::LoadBalancer interface to add methods which allow
a load balancer to optionally observe connection lifetime events and to
select a specific connection based on those events.
Implement this behavior in the DFP LoadBalancer to reuse HTTP/2 and HTTP/3
connections when the hash key, IP address, and certificate all match, conditional
on a new allow_coalesced_connections field in the DFP config.
Signed-off-by: Ryan Hamilton [email protected]
Risk Level: Low
Testing: Unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A