Skip to content

stack: add SwitchReady service#694

Merged
hawkw merged 11 commits intomainfrom
eliza/ver/profile-no-timeout
Oct 7, 2020
Merged

stack: add SwitchReady service#694
hawkw merged 11 commits intomainfrom
eliza/ver/profile-no-timeout

Conversation

@hawkw
Copy link
Contributor

@hawkw hawkw commented Oct 6, 2020

This is essentially a form of fallback that falls back when a primary
service takes too long to become ready. When the primary service's
poll_ready does not return ready for over the specified duration, the
secondary service is used until the primary becomes ready again,
resetting the readiness timeout. Erros from both services are
propagated.

I considered naming this ReadyFallback, but that name was already used
for an unrelated type in the fallback module. :)

olix0r and others added 2 commits October 6, 2020 16:23
This is essentially a form of fallback that falls back when a primary
service takes too long to become ready. When the primary service's
`poll_ready` does not return ready for over the specified duration, the
secondary service is used until the primary becomes ready again,
resetting the readiness timeout. Erros from both services are
propagated.

I considered naming this `ReadyFallback`, but that name was already used
for an unrelated type in the `fallback` module. :)
@hawkw hawkw requested review from a team and olix0r October 6, 2020 18:09
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

This looks really good! Thanks for tests.

  • Let's skip the layer impl for now and instead expose a SwitchReady::new
  • Let's base this directly off of main so it can merge independently?

Base automatically changed from ver/profile-no-timeout to main October 6, 2020 20:15
@hawkw hawkw requested a review from olix0r October 6, 2020 20:44
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

hooray, this looks great

impl<A, B, R> tower::Service<R> for SwitchReady<A, B>
where
A: tower::Service<R>,
B: tower::Service<R, Response = A::Response, Error = A::Error>,
Copy link
Member

Choose a reason for hiding this comment

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

note that if you use tower::util::Either, you don't need to require that the error types are the same (though they both need to be Into<Error>)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

didn't realize Either was Into<Error> when both arms are Into<Error>...mainly i thought i'd avoid adding a map_err here that could be added in a separate layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, i see, it has a future impl, that's neat

@hawkw hawkw merged commit 2799587 into main Oct 7, 2020
@hawkw hawkw deleted the eliza/ver/profile-no-timeout branch October 7, 2020 21:17
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Oct 10, 2020
This release overhauls the discovery and routing logic implemented by
the proxy: instead of looking at HTTP request metadata for service
discovery, the outbound proxy now exclusively use each connection's
target IP:PORT. This eager resolution eliminates per-request cache
binding; and supports using TrafficSplit with non-HTTP services.

This has a few side effects:

- The `l5d-dst-override` header is no longer honored.
- When the application attempts to connect to a pod IP, the proxy no
  longer load balances these requests among all pods in the service.
  The proxy will now honor session-stickiness as selected by an
  application-level load balancer.
- `TrafficSplits` are only applied when a client targets a service's IP.
- The proxy no longer performs DNS "canonicalization" to translate
  relative host header names to a fully-qualified form.

---

* Unify RequestFilter and Admit middlewares (linkerd/linkerd2-proxy#692)
* Only allow name-based profile discovery for inbound requests (linkerd/linkerd2-proxy#695)
* outbound: initial tests for TCP mTLS (with fewer moving parts) (linkerd/linkerd2-proxy#693)
* Stop honoring DESTINATION_GET_* configuration (linkerd/linkerd2-proxy#696)
* stack: add SwitchReady service (linkerd/linkerd2-proxy#694)
* telemetry: Remove trailing comma in build_info labels (linkerd/linkerd2-proxy#699)
* Update Rust to 1.47.0 (linkerd/linkerd2-proxy#701)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Oct 12, 2020
This release overhauls the discovery and routing logic implemented by
the proxy: instead of looking at HTTP request metadata for service
discovery, the outbound proxy now exclusively use each connection's
target IP:PORT. This eager resolution eliminates per-request cache
binding; and supports using TrafficSplit with non-HTTP services.

This has a few side effects:

- The `l5d-dst-override` header is no longer honored.
- When the application attempts to connect to a pod IP, the proxy no
  longer load balances these requests among all pods in the service.
  The proxy will now honor session-stickiness as selected by an
  application-level load balancer.
- `TrafficSplits` are only applied when a client targets a service's IP.
- The proxy no longer performs DNS "canonicalization" to translate
  relative host header names to a fully-qualified form.

---

* Unify RequestFilter and Admit middlewares (linkerd/linkerd2-proxy#692)
* Only allow name-based profile discovery for inbound requests (linkerd/linkerd2-proxy#695)
* outbound: initial tests for TCP mTLS (with fewer moving parts) (linkerd/linkerd2-proxy#693)
* Stop honoring DESTINATION_GET_* configuration (linkerd/linkerd2-proxy#696)
* stack: add SwitchReady service (linkerd/linkerd2-proxy#694)
* telemetry: Remove trailing comma in build_info labels (linkerd/linkerd2-proxy#699)
* Update Rust to 1.47.0 (linkerd/linkerd2-proxy#701)
* cache: Delete benchmarks (linkerd/linkerd2-proxy#705)
* outbound: Discover profiles for each unique TCP target (linkerd/linkerd2-proxy#704)
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.

2 participants