-
Notifications
You must be signed in to change notification settings - Fork 408
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
Feature Request: Support for Leader Election #93
Comments
Hi @twicksell - are you aware that Spring Integration has ZK Leadership Election Support. In SI, you can assign endpoints (message sources etc) to roles and the framework will automatically start/stop them when leadership is granted/revoked. |
I was not, thanks @garyrussell ! I think I still want this feature in a broader library than SI, but this is definitely a good place to borrow implementation from. I'll take a look through how thats implemented. |
WDYT about |
@garyrussell or @dsyer can you comment on why s-c-cluster was deprecated? |
Because all the features were moved to spring integration. Zookeeper leader election is first class over there now, and SI is (IMO) very broad, so I don't know why it wouldn't meet any requirement that people have. Jon's idea about |
Where do you think something like tying discovery to leadership should live? |
Discovery is clearly part of spring cloud, but health is spring boot (note also the example above was about eureka, so not using zk for discovery). All of the other features being requested are available in spring integration. I think we need to talk with @garyrussell about what we can offer people who want leader election but not messaging. Probably the zk features in SI are not very tightly coupled with messaging anyway. Someone should see what it's like to use. |
Correct; there is no messaging in the leadership election stuff. The core abstractions are here. And the ZK implementation here. There are really no hooks between this and messaging, even the I don't remember the details but we were up against a deadline and decided to lift the core abstractions from spring-cloud-cluster, although I think we tweaked them a little. I think the concern was dependency tangles and we discussed that, perhaps, these abstractions belong in a stand-alone top-level spring project It should be a clean lift and place since there are no SI dependencies at all. I have no objections to also moving the zk implementation to s-c-zk, as long as we don't end up with tangles by having s-i-zk depend on that. |
Generally, even on the main Spring Cloud site (http://projects.spring.io/spring-cloud/) there is information that it handles leader election, and for me, spring-cloud is a valid home for such functionality. Probably most of the users would be people using Spring Cloud. If it's somehow not possible I'll vote for moving it into a separate project like |
Spring Integration also has cluster-like feature in face of So, I vote for |
Any progress with it? :) |
@jkubrynski no |
I like the idea of a On another aspect, this leader election system implies some coupling to the underlying election implementation (in this issue we are talking about ZK). Of course a proper abstraction is possible to provide a plug n play experience. We have discovery servers and config servers. How about a Lock server ? I've build a simple POC inspired by the config server and @dsyer locksdemo. For now it's only a simple '@EnableLockServer' which auto configures a controller providing locks. But it could go further with a client offering a lock api and support for stuff like Such dedicated service would remove any dependencies from ZK, Hazelcast or jdbc for any component in need of locks or leader election. Further details here : spring-cloud/spring-cloud-commons#173 |
I've been thinking on how to implement such I'm clueless because the I'm suggesting to limit ourselves to a Here is an exemple :
|
I went a little further with an implementation and realized that using Spring This is why I am proposing something like this :
With a Edit : A working POC is available here |
I noticed a pattern we use occasionally at Netflix (Leader Election) wasn't represented in this framework so I thought I'd raise an issue and outline some of the nice features that a good Spring wrapper around the Curator recipe could offer.
The text was updated successfully, but these errors were encountered: