thrift proxy: add request shadowing support#17544
thrift proxy: add request shadowing support#17544mattklein123 merged 27 commits intoenvoyproxy:mainfrom
Conversation
This is the last PR in the series dedicated to adding mirroring support. It adds: * the ShadowWriter which is used by the Router filter to mirror requests * a ShadowRouter which is a RequestOwner that reuses the existing UpstreamRequest There's still room for more code sharing and better interfaces, but that can happen in future iterations. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
adisuissa
left a comment
There was a problem hiding this comment.
General API question, as I'm probably missing some context here:
Why not use the RequestMirrorPolicy type that is part of envoy.config.route.v3.RouteAction?
| // If not specified, all requests to the target cluster will be mirrored. | ||
| // | ||
| // For some fraction N/D, a random number in the range [0,D) is selected. If the | ||
| // number is <= the value of the numerator N, or if the key is not present, the default |
There was a problem hiding this comment.
I think you should remove the "or if the key is not present, the default value," as it complicates things, and you already wrote above "If not specified, all requests..." (I suggest moving this sentence to be the last, so you first explain what this field is, and then note the default value).
There was a problem hiding this comment.
This comes verbatim from the HTTP message, shall I clean up the description for both in a follow-up? Per my other comment, I rather keep them separate but happy to clarify both of them in one go.
|
@zuercher here's a quick exegesis of this implementation, before you jump into the details:
There's also the fact that there's no timeouts for shadow requests in this first iteration, but I think that can be done in a follow-up. And of course I'll address the low coverage issue once we agree on the general direction of the PR. cc: @fishcakez for feedback as well. |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
zuercher
left a comment
There was a problem hiding this comment.
We'll need to address this:
Code coverage for source/extensions/filters/network/thrift_proxy is lower than limit of 96.6 (93.4)
Code coverage for source/extensions/filters/network/thrift_proxy/router is lower than limit of 96.6 (77.5)
I expect it's probably because the pending_callbacks_ path isn't exercise in the tests (or isn't exercised for all the struct/field/list/map/set begin/end pairs.
source/extensions/filters/network/thrift_proxy/router/shadow_writer_impl.cc
Show resolved
Hide resolved
source/extensions/filters/network/thrift_proxy/router/shadow_writer_impl.h
Show resolved
Hide resolved
|
I'm out next week, but I think this is fine to merge once the code coverage failure is resolved. |
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Otherwise I get: ``` source/extensions/filters/network/thrift_proxy/protocol_converter.h:66:33: runtime error: load of value 208, which is not a valid value for type 'bool' ``` Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
|
/retest |
|
Retrying Azure Pipelines: |
|
Windows failure is unrelated: |
We could potentially, however I am hesitant to reuse given the comments there have HTTP-isms in them, e.g.: the host/authority headers and there's also the trace span bits which currently aren't implemented for ThriftProxy. So I think it's probably better to have a bit of duplication but a cleaner self contained configuration message. |
* main: (687 commits) ci: set build debug information from env (envoyproxy#17635) ext_authz: do the authentication even the direct response is set (envoyproxy#17546) upstream: various cleanups in connection pool code (envoyproxy#17644) owners: promote Dmitry to maintainer (envoyproxy#17642) quiche: client session supports creating bidi stream (envoyproxy#17543) Update HTTP/2 METADATA documentation. (envoyproxy#17637) ext_proc: Check validity of the :status header (envoyproxy#17596) test: add ASSERT indicating that gRPC stream has not been started yet (envoyproxy#17614) ensure that the inline cookie header will be folded correctly (envoyproxy#17560) cluster_manager: Make ClusterEntry a class instead of a struct (envoyproxy#17616) owners: make Raúl a Thrift senior extension maintainer (envoyproxy#17641) quiche: update QUICHE dependency (envoyproxy#17618) Delete mock for removed RouteEntry::perFilterConfig() method (envoyproxy#17623) REPO_LAYOUT.md: fix outdated link (envoyproxy#17626) hcm: forbid use of detection extensions with use_remote_addr/xff_num_trusted_hops (envoyproxy#17558) thrift proxy: add request shadowing support (envoyproxy#17544) ext_proc: Ensure that timer is always cancelled (envoyproxy#17569) Proposal: Add CachePolicy interface to allow for custom cache behavior (envoyproxy#17362) proto: fix verify to point at v3 only (envoyproxy#17622) api: move generic matcher proto to its own package (envoyproxy#17096) ...
* main: (687 commits) ci: set build debug information from env (envoyproxy#17635) ext_authz: do the authentication even the direct response is set (envoyproxy#17546) upstream: various cleanups in connection pool code (envoyproxy#17644) owners: promote Dmitry to maintainer (envoyproxy#17642) quiche: client session supports creating bidi stream (envoyproxy#17543) Update HTTP/2 METADATA documentation. (envoyproxy#17637) ext_proc: Check validity of the :status header (envoyproxy#17596) test: add ASSERT indicating that gRPC stream has not been started yet (envoyproxy#17614) ensure that the inline cookie header will be folded correctly (envoyproxy#17560) cluster_manager: Make ClusterEntry a class instead of a struct (envoyproxy#17616) owners: make Raúl a Thrift senior extension maintainer (envoyproxy#17641) quiche: update QUICHE dependency (envoyproxy#17618) Delete mock for removed RouteEntry::perFilterConfig() method (envoyproxy#17623) REPO_LAYOUT.md: fix outdated link (envoyproxy#17626) hcm: forbid use of detection extensions with use_remote_addr/xff_num_trusted_hops (envoyproxy#17558) thrift proxy: add request shadowing support (envoyproxy#17544) ext_proc: Ensure that timer is always cancelled (envoyproxy#17569) Proposal: Add CachePolicy interface to allow for custom cache behavior (envoyproxy#17362) proto: fix verify to point at v3 only (envoyproxy#17622) api: move generic matcher proto to its own package (envoyproxy#17096) ... Signed-off-by: Michael Puncel <mpuncel@squareup.com>
This is the last PR in the series dedicated to adding mirroring support. It adds: * the ShadowWriter which is used by the Router filter to mirror requests * a ShadowRouter which is a RequestOwner that reuses the existing UpstreamRequest There's still room for more code sharing and better interfaces, but that can happen in future iterations. Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
This is the last PR (5/5) in the series dedicated to adding mirroring support.
It adds:
There's still room for more code sharing and better interfaces, but that
can happen in future iterations.
Signed-off-by: Raul Gutierrez Segales rgs@pinterest.com