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

iphash does not send clients with the same source IP to the same backend #229

Closed
nycterent opened this issue Aug 5, 2019 · 1 comment
Closed
Assignees
Milestone

Comments

@nycterent
Copy link

I am experiencing similar issue, but I cannot fix it with my limited skills. I have multiple backends and using iphash balance method. My expectations are that all connections coming from specific ip would be sent to the same backend, but I can see that it is not the case (sometimes it works and sometimes does not):

2019-08-05 07:22:44 [INFO ] (execFetch): Fetched [{b.b.b.131:4500 p=1,w=1,l=true,a=0} {b.b.b.133:4500 p=1,w=1,l=true,a=0} {b.b.b.135:4500 p=1,w=1,l=true,a=0} {b.b.b.137:4500 p=1,w=1,l=true,a=0} {b.b.b.139:4500 p=1,w=1,l=true,a=0} {b.b.b.141:4500 p=1,w=1,l=true,a=0}] 2019-08-05 07:22:44 [INFO ] (execFetch): Fetched [{b.b.b.131:500 p=1,w=1,l=true,a=0} {b.b.b.133:500 p=1,w=1,l=true,a=0} {b.b.b.135:500 p=1,w=1,l=true,a=0} {b.b.b.137:500 p=1,w=1,l=true,a=0} {b.b.b.139:500 p=1,w=1,l=true,a=0} {b.b.b.141:500 p=1,w=1,l=true,a=0}] 2019-08-05 07:23:11 [DEBUG] (udp/server): Hash key:c.c.c.51:48959 2019-08-05 07:23:11 [DEBUG] (udp/server): Selecting backend: b.b.b.137:500 2019-08-05 07:23:11 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:11 [DEBUG] (udp/server): Selecting backend: b.b.b.137:4500 2019-08-05 07:23:11 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:11 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:11 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:11 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:12 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:13 [DEBUG] (udp/server): Hash key:c.c.c.51:51167 2019-08-05 07:23:24 [DEBUG] (udp/server): Hash key:c.c.c.51:20632 2019-08-05 07:23:24 [DEBUG] (udp/server): Selecting backend: b.b.b.133:500 2019-08-05 07:23:24 [DEBUG] (udp/server): Hash key:c.c.c.51:14903 2019-08-05 07:23:24 [DEBUG] (udp/server): Selecting backend: b.b.b.135:4500 2019-08-05 07:23:28 [DEBUG] (udp/server): Hash key:c.c.c.51:14903

I am guessing that somewhere outgoing port of the client is used in a hash

Using gobetween_0.8.0+snapshot_linux_amd64

Originally posted by @nycterent in #176 (comment)

@illarion illarion self-assigned this Aug 5, 2019
@illarion illarion added this to the 0.8.0 milestone Aug 5, 2019
@illarion
Copy link
Collaborator

illarion commented Aug 5, 2019

Looks like the regression of the bug caused by random nature of golang maps. Backends are stored internally as map. Thank you for reporting

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

No branches or pull requests

2 participants