-
Notifications
You must be signed in to change notification settings - Fork 846
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
Simplify leadership election code #4908
Comments
I agree with most of your points. Some additions:
|
Scala's own recommendation is to have a fixed size threadpool for blocking IO. |
The election code is using a different client instance. Should it use the same as the storage? |
I'd also like |
@jeschkies why even have |
@jeschkies it probably should use the same client instance but I'm not sure if Curator does any zookeeper connection pool aggregation behind the scenes. On second thought, we should research more. What happens if there is a high amount of read/write traffic on the storage and it gets backlogged. Could we lose leadership? I'm not sure what the consequences are. |
Note: This issue has been migrated to https://jira.mesosphere.com/browse/MARATHON-2008. For more information see https://groups.google.com/forum/#!topic/marathon-framework/khtvf-ifnp8. |
Now that we've migrated to curator's LeaderLatch for leader election, it seems that our leader election code is doing WAY more than necessary. Some things I would like to see fixed:
AnythingBase
is almost always an anti-pattern. Get rid ofElectionServiceBase
. If we need a common interface, define it. Prefer to put common behavior in helper methods rather than inherit them,e tc.The falling scala script illustrates how concise our leader election module should be:
https://gist.github.com/timcharper/22a1bca65e9a8268225dcfb97420cdf7
The text was updated successfully, but these errors were encountered: