-
Notifications
You must be signed in to change notification settings - Fork 467
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
Change agedFailoverTimeMultiplier config to enablePriorityLeaseAssignment #1317
Change agedFailoverTimeMultiplier config to enablePriorityLeaseAssignment #1317
Conversation
@@ -87,7 +87,7 @@ public void setWorkerId(String workerId) { | |||
@ConfigurationSettable(configurationClass = LeaseManagementConfig.class) | |||
private long failoverTimeMillis; | |||
@ConfigurationSettable(configurationClass = LeaseManagementConfig.class) | |||
private int agedFailoverTimeMultiplier; | |||
private Boolean doPriorityLeaseTaking; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After doing some testing, I found that when this value is a primitive boolean
, the config isn't set properly. This applies to all other boolean configs in multilang as well. Will make another PR fixing it for other configs
@@ -57,7 +57,7 @@ public class LeaseManagementConfig { | |||
public static final long DEFAULT_COMPLETED_LEASE_CLEANUP_INTERVAL_MILLIS = Duration.ofMinutes(5).toMillis(); | |||
public static final long DEFAULT_GARBAGE_LEASE_CLEANUP_INTERVAL_MILLIS = Duration.ofMinutes(30).toMillis(); | |||
public static final long DEFAULT_PERIODIC_SHARD_SYNC_INTERVAL_MILLIS = 2 * 60 * 1000L; | |||
public static final int DEFAULT_AGED_FAILOVER_TIME_MULTIPLIER = 3; | |||
public static final boolean DEFAULT_DO_PRIORITY_LEASE_TAKING = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe consider renaming to enable_priority_lease_assignment ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that naming better, updated
* (agedFailoverTimeMultiplier * failoverTimeMillis) are taken with priority, disregarding the target | ||
* but obeying the maximum limit per worker. | ||
* Whether workers should take very expired leases at priority. A very expired lease is when a worker does not | ||
* renew its lease in 3 * {@link LeaseManagementConfig#failoverTimeMillis}. Very expired leases will be taken at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also mentioned newly created leases due to shard mutation that are not assigned to any worker are also considered very-expired ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
final List<Lease> allLeases = new ArrayList<>(); | ||
allLeases.add(createLease("foo", "2", MOCK_CURRENT_TIME)); | ||
allLeases.add(createLease("bar", "3", veryOldThreshold - 1)); | ||
allLeases.add(createLease("baz", "4", veryOldThreshold + 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add some leases not assigned to any worker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
…slabs#1317) * Change agedFailoverTimeMultiplier config to doPriorityLeaseTaking
Issue #, if available:
Description of changes:
Change the agedFailoverTimeMultiplier config to doPriorityLeaseTaking. This allows clients to disable the priority lease taking logic entirely if they choose
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.