Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bound id as dest in TTwitter thrift requests #1775

Open
adleong opened this issue Jan 10, 2018 · 3 comments
Open

Use bound id as dest in TTwitter thrift requests #1775

adleong opened this issue Jan 10, 2018 · 3 comments

Comments

@adleong
Copy link
Member

adleong commented Jan 10, 2018

When Linkerd proxies a TTwitter thrift request, it reads the dest header out of the message envelope and uses it as part of the identified service name. For example, if Linkerd receives a TTwitter request for a thrift service named service with dest: /foo then it will identify the request as /svc/foo/service. Linkerd also propagates the dest header on the outgoing message.

For Linkerd-to-Linkerd requests, this means that both the outgoing and incoming Linkerds receive the same value in the dest header and both do delegation based on this value. If the delegation results in a NameTree with weighted unions, a different choice could be made on the outgoing router vs the incoming router.

Instead of propagating the dest header, Linkerd could instead write the client id into the dest header of messages that it sends. This means that the incoming Linkerd would receive a dest header which is a concrete client name instead of the dest sent by the original client.

Note that this is a breaking behavioral change. Any services that depend on receiving the original value of the dest header will break.

See related: #950

@yllions
Copy link

yllions commented Jan 21, 2018

hello, I want to know how can i add service name to twitter thrift 'dest' request header for finagle thrift client?

@adleong
Copy link
Member Author

adleong commented Jan 22, 2018

Hi @xiaoerlyl, unfortunately the finagle thrift client does not set the dest request header. Linkerd uses a special filter in order to set this header:

https://github.com/linkerd/linkerd/blob/master/linkerd/protocol/thrift/src/main/scala/com/twitter/finagle/buoyant/linkerd/TTwitterClientFilter.scala

@yllions
Copy link

yllions commented Jan 23, 2018

@adleong thanks. This really helps.

Tim-Brooks pushed a commit to Tim-Brooks/linkerd that referenced this issue Dec 20, 2018
Add a check to `linkerd check` which validates all service profile resources.  In particular it checks:
* does the service profile refer to an existent service
* is the service profile valid

Signed-off-by: Alex Leong <[email protected]>
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

No branches or pull requests

2 participants