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

Fix (*consistentHash).Apply #2983

Merged
merged 2 commits into from
Mar 15, 2024
Merged

Fix (*consistentHash).Apply #2983

merged 2 commits into from
Mar 15, 2024

Conversation

RomanZavodskikh
Copy link
Member

consistentHash is the only load balancer algorighm which uses index of original endpoints list, that is why ctx.Route.LBEndpoints (original list) should be used there instead of ctx.LBEndpoints (list with filtered endpoints).

@RomanZavodskikh RomanZavodskikh added the bugfix Bug fixes and patches label Mar 14, 2024
@MustafaSaber
Copy link
Member

👍

@szuecs
Copy link
Member

szuecs commented Mar 14, 2024

Do you want to add a test?

@RomanZavodskikh
Copy link
Member Author

RomanZavodskikh commented Mar 14, 2024

The tests are covering the bug fixed in this PR.
After fix:

$ git checkout fixConsistentHashChoice 
Already on 'fixConsistentHashChoice'
$ go test ./proxy/ -run=^TestPHCForMultipleHealthyAndOneUnhealthyEndpoints$ -count=1 
ok  	github.com/zalando/skipper/proxy	17.960s
$

Before fix:

$ git checkout HEAD^
Note: switching to 'HEAD^'.

You are in 'detached HEAD' state. You can ...
$ go test ./proxy/ -run=^TestPHCForMultipleHealthyAndOneUnhealthyEndpoints$ -count=1 
...
tp package during roundtrip: roundTrip fail injected, remote host: 127.0.0.1, request: \"GET / HTTP/1.1\", host: 127.0.0.1:41775, user agent: \"Go-http-client/1.1\""
--- FAIL: TestPHCForMultipleHealthyAndOneUnhealthyEndpoints (19.28s)
    --- FAIL: TestPHCForMultipleHealthyAndOneUnhealthyEndpoints/consistentHash (4.75s)
        healthy_endpoints_test.go:220: 
            	Error Trace:	/home/rzavodskikh/skipper/proxy/healthy_endpoints_test.go:220
            	Error:      	Max difference between 792 and 6367 allowed is 1500, but difference was -5575
            	Test:       	TestPHCForMultipleHealthyAndOneUnhealthyEndpoints/consistentHash
FAIL
FAIL	github.com/zalando/skipper/proxy	19.428s
FAIL

@RomanZavodskikh RomanZavodskikh force-pushed the fixConsistentHashChoice branch 2 times, most recently from ba7d572 to 85ca505 Compare March 14, 2024 13:49
Roman Zavodskikh added 2 commits March 14, 2024 20:21
@AlexanderYastrebov
Copy link
Member

👍

1 similar comment
@RomanZavodskikh
Copy link
Member Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bug fixes and patches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants