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

当对服务起别名时,拉回来的路由规则中的service和namespace仍旧是老的,导致会存在对路由规则处理的错误。 #892

Closed
Cshiyuan opened this issue Jan 9, 2023 · 3 comments
Assignees
Labels
bug Something isn't working in processed processing question Further information is requested

Comments

@Cshiyuan
Copy link
Contributor

Cshiyuan commented Jan 9, 2023

当对服务起别名时,拉回来的路由规则中的service和namespace仍旧是老的。可能会存在对路由规则处理的错误。

@Cshiyuan Cshiyuan added the question Further information is requested label Jan 9, 2023
@chuntaojun chuntaojun added this to the v1.15.0 milestone Feb 10, 2023
@chuntaojun
Copy link
Member

chuntaojun commented Feb 15, 2023

社区开发团队设想的解决方案

1、拉取服务治理规则的 DiscoverResponse 新增 aliasFor 字段用于记录原始服务名称

{
    "code":200000,
    "info":"",
    "type":"",
    # 请求的服务名称信息,可能是服务别名,也可能就是服务名
    "service":{
        "name":"",
        "namespace":""
    },
    # 原始服务名称信息,一定不是别名
    "aliasFor":{
        "name":"",
        "namespace":""
    }
}

2、SDK的路由、熔断插件,根据规则的 originService 以及 service 信息,新增基于别名的匹配计算

Screenshot 2023-02-28 at 10 25 08

@chuntaojun chuntaojun added the bug Something isn't working label Feb 21, 2023
@andrewshan andrewshan changed the title 当对服务起别名时,拉回来的路由规则中的service和namespace仍旧是老的。可能会存在对路由规则处理的错误。 当对服务起别名时,拉回来的路由规则中的service和namespace仍旧是老的,导致会存在对路由规则处理的错误。 Feb 23, 2023
@chuntaojun chuntaojun added the in processed processing label Feb 28, 2023
@chuntaojun chuntaojun modified the milestones: v1.15.0, v1.16.0 Mar 13, 2023
@andrewshan
Copy link
Member

andrewshan commented Mar 14, 2023

image

需要支持的场景

@andrewshan
Copy link
Member

  • 路由&熔断:只会发生在主调方,解决的场景是用户在主调方,通过别名调用被调方的服务,通过别名查询及执行相应的、关联的是真实服务名的规则。
  • 限流:可能发生在主调方和被调方。
    • 假如用户在被调方,那么他可以获取到被调方的真实服务名,同时主调透传的服务名也只会是真实服务名,不需要这个特性;
    • 假如用户在主调方,那么与路由和熔断一样,解决的还是被调用别名的场景

@chuntaojun chuntaojun self-assigned this Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in processed processing question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants