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

Release leases if the cluster weight is 0 #1048

Merged
merged 1 commit into from Jun 10, 2019

Conversation

Projects
None yet
2 participants
@ryanhall07
Copy link
Collaborator

commented Jun 10, 2019

This allows applications to run in an Active-Passive mode. If the
current weight for a cluster is 0, leases are not acquired or released
if already acquired. This allows an application to only run leased
background tasks in the Active region.

This iteration requires misk users to provide their own implementation
for ClusterWeightProvider. SQ services will use a global ZK impl, which
we could consider contributing as well in the future.

Release leases if the cluster weight is 0
This allows applications to run in an Active-Passive mode. If the
current weight for a cluster is 0, leases are not acquired or released
if already acquired. This allows an application to only run leased
background tasks in the Active region.

This iteration requires misk users to provide their own implementation
for ClusterWeightProvider. SQ services will use a global ZK impl, which
we could consider contributing as well in the future.

@ryanhall07 ryanhall07 requested review from swankjesse, mmihic and mightyguava Jun 10, 2019

*/
class ActiveClusterWeight : ClusterWeightProvider {

override fun get(): Int {

This comment has been minimized.

Copy link
@swankjesse

swankjesse Jun 10, 2019

Member

don’t love Integers for this, though I also don’t love floats?

This comment has been minimized.

Copy link
@ryanhall07

ryanhall07 Jun 10, 2019

Author Collaborator

i'm open to suggestions, but not really a fan of floats. is the float value 0.801 or 80.1? at least an Int is clear in that regard. Loss of precision didn't seem important for something like cluster weights.

I briefly considered a boolean, since in practice it's 0 or 100. However, it's reasonable in the future we might support a canary cluster running some percentage of the background tasks.

@ryanhall07 ryanhall07 merged commit 615cc7b into master Jun 10, 2019

2 checks passed

ci/circleci: java Your tests passed on CircleCI!
Details
ci/circleci: node Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.