[go: up one dir, main page]

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

need sticky client ip hashing in case of both fail-over and recovery #191

Open
AmitBawer opened this issue Dec 17, 2018 · 11 comments
Open
Assignees
Labels
Milestone

Comments

@AmitBawer
Copy link

Currently release 0.6.1 allows using iphash1 for client-ip hashing load balancing strategy.
yet according to documentation it is guaranteed that active back-end traffic will remain redirected as is in case another back-end fails. When the failed back-end recovers it is possible that active back-ends traffic will get reshuffled as in the original iphash method.
We need a client-ip hashing method which guarantees that the active traffic is kept stable in both cases.

@yyyar yyyar added the feature label Dec 17, 2018
@AmitBawer
Copy link
Author
AmitBawer commented Dec 17, 2018

btw if current iphash1 is stable in both cases (failover & recovery of backend from static list) when discovery kind="static" - it should suffice. However it is not clearly mentioned in GB documentation/code.

@nickdoikov
Copy link
Collaborator

@illarion could you please add more description to Iphash1/iphash ?

@yyyar yyyar added this to the 0.7.0 milestone Dec 23, 2018
@yyyar yyyar self-assigned this Dec 23, 2018
@AmitBawer
Copy link
Author
AmitBawer commented Dec 24, 2018

@nickdoikov - is it known what is the behavior for iphash1 in case of static backends list where no new servers are discovered but some can fail and recover?

@illarion
Copy link
Collaborator

@AmitBawer yes it is known and it's really simple: in case of failure of some backend, its clients get rebalanced to other backends. Other clients are not rebalanced. If the affected backend recovers, only its clients get rebalanced back.

@AmitBawer
Copy link
Author
AmitBawer commented Dec 24, 2018

@illarion / @nickdoikov its important for our use-case that stickiness is preserved, which means that if some clients are redirected from a failed backend X to another backend Y, then even if X recovers, the clients redirected to Y remain there.

yyyar added a commit that referenced this issue Dec 25, 2018
@yyyar
Copy link
Owner
yyyar commented Dec 25, 2018

Thanks for your contribution, @AmitBawer
Sticky iphash implementation seems something very nice to have in gobetween.
We'll work on "sticky" version as new iphash2 balance method.
I think it will accept some parameters like expiration time and max sticky table size, like in haproxy.

@AmitBawer
Copy link
Author

@yyyar Thank you indeed, looking forward for such functionality.

@shantanugadgil
Copy link
Contributor

Reading the requirement of @AmitBawer an option named no_rebalance_after_recover came to mind ... Although I am not sure of the exact need. 😁😁😁

Maybe just a delay for rebalance could suffice, I dunno!

@AmitBawer
Copy link
Author

@shantanugadgil , i believe that if no rebalance never occurs after recovery we might end up theoretically in situation where all clients are forever redirected to the ever-healthy backend and the recovered one would remain idle. Unless you have meant something else.

@AmitBawer AmitBawer changed the title need stable client ip hashing in case of both fail-over and recovery need sticky client ip hashing in case of both fail-over and recovery Dec 26, 2018
@nuttysquirrel
Copy link
nuttysquirrel commented Mar 10, 2019

Thanks for your contribution, @AmitBawer
Sticky iphash implementation seems something very nice to have in gobetween.
We'll work on "sticky" version as new iphash2 balance method.
I think it will accept some parameters like expiration time and max sticky table size, like in haproxy.

I wonder if sticky is actually just a reasonable option for any of the balance methods.
ie, you might like the 'weight' balance method to be sticky or not sticky, same for iphash, priority, etc etc.
I recently submitted a pull request for a 'priority' balance mechanism, and am extending that mechanism to include another called 'stickyPriority'.
Thinking about it more, if you wrapped "stickyXXX" to just do the "sticky" component, then call the normal balance function "XXX" for new sessions, you'd probably have a nice extensible framework moving forward...

@nuttysquirrel
Copy link
nuttysquirrel commented Mar 22, 2019

so, I wrote 'sticky priority' and submitted it, see #209
its seems to work for me & my use case.

@illarion / @nickdoikov its important for our use-case that stickiness is preserved, which means that if some clients are redirected from a failed backend X to another backend Y, then even if X recovers, the clients redirected to Y remain there.

It meets this criteria mentioned by @AmitBawer above.

@illarion illarion modified the milestones: 0.7.0, 0.8.0 Mar 22, 2019
yyyar added a commit that referenced this issue Jun 1, 2019
@yyyar yyyar modified the milestones: 0.8.0, Selected for development Jun 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants