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

revert fiber to 2.0 #299

Merged
merged 1 commit into from
Dec 5, 2022
Merged

Conversation

leonlnj
Copy link
Contributor

@leonlnj leonlnj commented Dec 2, 2022

Description

In fiber 2.0, when Traffic Rules are used with Selective routing strategy in standard ensembler setup. Underlying, the router are composed of two nested lazy router. With the default Exhaustive routing strategy, it is composed of a parent lazy router (which is used for traffic splitting) and child eager router (to call all routers in parallel).

Fiber 2.1-rc1 fixes the above problem with route request duration metric but introduce another bug to route component metric To explain in context

Fiber 2.0
Step 1 Parent layer - lazy router (for both routing strategy)

  1. Lazy router calls TrafficSplittingStrategy and obtain the traffic rule labels
  2. Invoke child common with traffic labels added to context

Step 2a Second layer - eager router (exhaustive strategy)

  1. Calls all routes with context passed (contain traffic label, which logs metric correctly)
  2. Calls DefaultTuringRoutingStrategy and get empty label
  3. Return with no labels

Step 2b Second layer - lazy router (selective strategy)

  1. Calls DefaultTuringRoutingStrategy and get empty label
  2. Calls all routes with context passed (contain NO traffic label, as it is pass the label from DefaultTuringRoutingStrategy which logs metric incorrectly)
  3. Return with no labels

Step 3 Back to first parent layer - lazy router (for both routing strategy)

  1. Both child pass back response with no label
  2. Return response with traffic labels from TrafficSplittingStrategy

Fiber 2.1-rc1
Step 1 Parent layer - lazy router (for both routing strategy), no change from the above

  1. Lazy router calls TrafficSplittingStrategy and obtain the traffic rule labels
  2. Invoke child common with traffic labels added to context

Step 2a Second layer - eager router (exhaustive strategy)

  1. Calls all routes with context passed (contain traffic label, which logs metric correctly)
  2. Calls DefaultTuringRoutingStrategy, get empty label and merge labels with parent's label
  3. Return with merged labels

Step 2b Second layer - lazy router (selective strategy)

  1. Calls DefaultTuringRoutingStrategy , get empty label and merge labels with parent's label
  2. Calls all routes with context passed (contain traffic label, as it merged with parent label, which logs metric correctly)
  3. Return with merged labels

Step 3 Back to first parent layer - lazy router (for both routing strategy)

  1. Both child pass back response with merged label (problem occurs here)
  2. Return response with traffic labels from TrafficSplittingStrategy by merging back return label, causing double labelling

Fundamentally, this behaviour occur due to eager and lazy router calling routes with different sequence.

  • eager router call route with parent context, then call strategy
  • lazy router call strategy, then call route with strategy context

Hence this PR reverts Fiber 2.1-rc1, until a solution fixes both metrics.

@leonlnj leonlnj self-assigned this Dec 2, 2022
@leonlnj leonlnj requested a review from a team December 2, 2022 10:41
@leonlnj leonlnj marked this pull request as ready for review December 2, 2022 10:41
@deadlycoconuts
Copy link
Contributor

Thanks for the deep investigation into this! We'll have to find another fix somehow...🤔 Temporarily approving this so we can cut the UI fixes for v1.8.1.

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