[ 
https://issues.apache.org/jira/browse/CASSANDRA-11258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15298265#comment-15298265
 ] 

Marcus Olsson commented on CASSANDRA-11258:
-------------------------------------------

Sorry for the delay. I've added the check for the existing lease in case we get 
a WTE 
[here|https://github.com/emolsson/cassandra/commit/cd6266ffc73be3a874d15ad0e2302652e316fed9].

bq. Sounds good! Perhaps we can add an expirationTime column to the lease table 
and compare it with the current value to see if it was updated, to avoid 
keeping track of TTLs? This would also provide a means for other nodes to check 
when the current lease will expire if necessary.
+1 I've added {{expirationTime}} to the patch. I've also changed from 
{{boolean}} to {{Optional<Long>}} for {{lease()}}, {{renewLease()}} and 
{{holdsLeaseUntil()}} so they return the stored {{expirationTime}}.

bq. Got it, thanks for the clarification! I was initially thinking renewLease 
would only extend the current lease period, but updating it for a smaller 
period might be a valid use case. We should probably make this more explicit in 
the renewLease javadoc.
I've added an example in the javadoc, hopefully that will make it clearer. I'm 
a bit unsure about the ["This duration is not added to the current 
duration."|https://github.com/emolsson/cassandra/commit/cd6266ffc73be3a874d15ad0e2302652e316fed9#diff-77d0ba5e1f9b13e38d862eec4591998aR39]
 part of the javadoc that I added, it might confuse more than it contributes, 
WDYT?

> Repair scheduling - Resource locking API
> ----------------------------------------
>
>                 Key: CASSANDRA-11258
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11258
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: Marcus Olsson
>            Assignee: Marcus Olsson
>            Priority: Minor
>
> Create a resource locking API & implementation that is able to lock a 
> resource in a specified data center. It should handle priorities to avoid 
> node starvation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to