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

Denis Chudov commented on IGNITE-23857:
---------------------------------------

This condition provides intuitive and predictable behavior: when there are no 
more groups, leases are removed. I'd like to leave a comment there:
{code:java}
This condition allows to skip the meta storage invoke when there are no leases 
to update (renewedLeases.isEmpty()). However there is the case when we need to 
save empty leases collection: when the assignments are empty and leasesCurrent 
(those that reflect the meta storage state) is not empty. The negation of this 
condition gives us the condition to skip the update and the result is: 
!(emptyAssignments && !leasesCurrent.leaseByGroupId().isEmpty()) == 
(!emptyAssignments || leasesCurrent.leaseByGroupId().isEmpty()){code}
 

> Do not process absent groups in cluster in lease updater
> --------------------------------------------------------
>
>                 Key: IGNITE-23857
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23857
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Vladislav Pyatkov
>            Priority: Major
>              Labels: ignite-3
>
> h3.Motivation
> We are getting rid of expired leases (for removed replication groups) in the 
> common cycle of maintenance of the leases.
> > LeaseUpdater.Updater#updateLeaseBatchInternal
> In a case when all replication groups are removed, we add this code to no 
> miss update:
> {code}
> boolean emptyAssignments = 
> aggregatedStableAndPendingAssignmentsByGroups.isEmpty();
>             if (renewedLeases.isEmpty() && (!emptyAssignments || 
> leasesCurrent.leaseByGroupId().isEmpty())) {
>     LOG.debug("No leases to update found.");
>     return;
> }
> {code}
> We can simplify the condition:
> {code}
> renewedLeases.isEmpty()
> {code}
> but in this case we will store expired leases until the new one does not 
> appear.
> h3.Definition of done
> Make the condition simpler.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to