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

Router support set fallback route as downgrading routing strategy #1386

Closed
chengyouling opened this issue Dec 15, 2023 · 1 comment
Closed
Assignees
Labels
area/plugin Issues or PRs releated to sermant plugin service kind/enhancement Issues or PRs releated to sermant enhancement

Comments

@chengyouling
Copy link
Collaborator

What would you like to be enhanced?

Router add fallback rule to support downgrading routing strategy.

Why is this needed?

Support multi permanent path routing degradation strategy.

@chengyouling chengyouling added the kind/enhancement Issues or PRs releated to sermant enhancement label Dec 15, 2023
@luanwenfei-venus luanwenfei-venus added the area/plugin Issues or PRs releated to sermant plugin service label Dec 18, 2023
@provenceee
Copy link
Collaborator

provenceee commented Dec 19, 2023

标签路由目前存在以下问题,当存在多标签的实例时,有可能存在以下的配置:

- precedence: 0
  route:
  - weight: 100
    tags:
      cas_lane_tag: base
    weight: 100
- precedence: 1
  match:
    headers:
      x-cse-canary:
        exact: red
  route:
  - weight: 100
    tags:
      cas_lane_tag: red
- precedence: 2
  match:
    headers:
      x-cse-canary:
        exact: gray
  route:
  - weight: 100
    tags:
      cas_lane_tag: gray

那么会存在一种场景,在全链路灰度的情况下,如果一个请求匹配上了cas_lane_tag: gray的路由,但是却没有部署实例,那么将会根据负载均衡策略选取实例,也就说有可能会路由到red组的实例或者base组的实例,但大多数场景下,更多的是希望能路由到base组,所以需要增加fallback机制,配置可拓展为:

- precedence: 0
  route:
  - weight: 100
    tags:
      cas_lane_tag: base
    weight: 100
- precedence: 1
  match:
    headers:
      x-cse-canary:
        exact: red
  route:
  - weight: 100
    tags:
      cas_lane_tag: red
  fallback:
  - tags:
      cas_lane_tag: base
    weight: 100
- precedence: 2
  match:
    headers:
      x-cse-canary:
        exact: gray
  route:
  - weight: 100
    tags:
      cas_lane_tag: gray
  fallback:
  - tags:
      cas_lane_tag: base
    weight: 100

那么,没有red组或者gray组的情况下,将fallback到base组,解决了之前的不足

@luanwenfei-venus luanwenfei-venus changed the title 【Enhancement】 router support set fallback route as downgrading routing strategy Router support set fallback route as downgrading routing strategy Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugin Issues or PRs releated to sermant plugin service kind/enhancement Issues or PRs releated to sermant enhancement
Projects
None yet
Development

No branches or pull requests

4 participants