Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Sticky server feature #2

wants to merge 1 commit into


None yet
2 participants

Passing ":sticky true" as an option to clustered-slackerc will enable logic to allow a client to prefer the first server it connects to, while still retaining the ability to connect to a different server if the first becomes unavailable.

This is useful for applications that prioritize high availability over load balancing.


sunng87 commented Oct 16, 2012

Thank you for the patch. I think your requirement is to specify a master server manually, right ?

The design of slacker cluster client is to hide server from the client. The client doesn't have to know anything about the server. So I think adding this option might break the design.

I prefer to add an option on the server side. It will be something like ":run-as-master?". Master server will publish itself as "master-node" of all its namespaces. The client will then send all requests to it.

I don't want to specify a master server. I want the client to pick a random server initially, but then keep using that server as long as it's available. If that server goes down, then pick another one at random and prefer it.

I think this approach still effectively hides the server from client, as we're not explicitly telling the client which server to connect to initially.

Having a :run-as-master? flag on the server side seems like it will introduce a single point of failure, unless the server pool will elect a new master in the event of failure.

FWIW, I've found a bug in my implementation, so definitely don't merge anything yet :-)

sunng87 pushed a commit that referenced this pull request Feb 24, 2014

added :first to grouping strategy. the client will always call the
first server available.

resolved the sticky server feature request #2.

sunng87 commented Feb 24, 2014

Hi @johnchapin , it has been quite a long time since last update. But I just want to let you know that I have added new option :grouping :first in clustered-client to support sticky server feature you mentioned.

This feature will be available in 0.11 and currently available in 0.11.0-SNAPSHOT from clojars.

@sunng87 sunng87 closed this Feb 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment