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

simplify sticky balancer and fix a bug #4169

Merged
merged 2 commits into from
Jun 7, 2019

Conversation

ElvinEfendi
Copy link
Member

@ElvinEfendi ElvinEfendi commented Jun 6, 2019

What this PR does / why we need it:

  • Simplify sticky.lua
  • Fix a bug in the feature introduced at Change upstream on error when sticky session balancer is used #4048. The problem is the code looks at last failing upstream only. However if Nginx is configured to retry more than 2 upstreams then it is possible that sticky balancer picks a previously failing upstream again. This PR makes sure sticky balancer looks at all previously failing upstreams for given request and does not pick any of them as a new upstream. cc @fedunineyu

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 6, 2019
@k8s-ci-robot k8s-ci-robot requested review from aledbf and bowei June 6, 2019 20:27
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 6, 2019
@codecov-io
Copy link

codecov-io commented Jun 6, 2019

Codecov Report

Merging #4169 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4169      +/-   ##
==========================================
+ Coverage   57.63%   57.66%   +0.03%     
==========================================
  Files          87       87              
  Lines        6463     6463              
==========================================
+ Hits         3725     3727       +2     
+ Misses       2307     2306       -1     
+ Partials      431      430       -1
Impacted Files Coverage Δ
internal/ingress/metric/collectors/process.go 90.42% <0%> (+2.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e76418c...e2c6202. Read the comment docs.

@ElvinEfendi ElvinEfendi force-pushed the refactor-sticky-balancer branch 2 times, most recently from c6d83a4 to 09988b0 Compare June 6, 2019 20:42
@ElvinEfendi ElvinEfendi changed the title [WIP] simplify sticky balancer simplify sticky balancer and fix a bug Jun 6, 2019
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 6, 2019
@aledbf
Copy link
Member

aledbf commented Jun 7, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 7, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, ElvinEfendi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 2879309 into kubernetes:master Jun 7, 2019
@ElvinEfendi ElvinEfendi deleted the refactor-sticky-balancer branch June 7, 2019 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants