vldpyatkov commented on code in PR #4798: URL: https://github.com/apache/ignite-3/pull/4798#discussion_r1867971274
########## modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java: ########## @@ -535,6 +542,24 @@ private void updateLeaseBatchInternal() { ); } + leasesCurrent.leaseByGroupId().forEach(renewedLeases::putIfAbsent); + + for (Iterator<Entry<ReplicationGroupId, Lease>> iter = renewedLeases.entrySet().iterator(); iter.hasNext(); ) { + Map.Entry<ReplicationGroupId, Lease> entry = iter.next(); + ReplicationGroupId groupId = entry.getKey(); + Lease lease = entry.getValue(); + + if (clockService.before(lease.getExpirationTime(), currentTime) + && !groupsAmongCurrentStableAndPendingAssignments.contains(groupId)) { + iter.remove(); + } else if (prolongableLeaseGroupIds.contains(groupId) + && !lease.getExpirationTime().equals(newExpirationTimestamp)) { + entry.setValue(prolongLease(groupId, lease, null, newExpirationTimestamp)); + } + } + + byte[] renewedValue = new LeaseBatch(renewedLeases.values()).bytes(); + if (Arrays.equals(leasesCurrent.leasesBytes(), renewedValue)) { Review Comment: This condition has to be moved above the last loop. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org