vldpyatkov commented on code in PR #4755: URL: https://github.com/apache/ignite-3/pull/4755#discussion_r1861645052
########## modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/negotiation/LeaseNegotiator.java: ########## @@ -53,33 +53,30 @@ public class LeaseNegotiator { */ public LeaseNegotiator(ClusterService clusterService) { this.clusterService = clusterService; - - this.leaseToNegotiate = new ConcurrentHashMap<>(); } /** * Tries negotiating a lease with its leaseholder. * The negotiation will achieve after the method is invoked. Use {@link #getAndRemoveIfReady(ReplicationGroupId)} to check a result. * - * @param lease Lease to negotiate. - * @param force If the flag is true, the process tries to insist of apply the lease. + * @param agreement Lease agreement to negotiate. */ - public void negotiate(Lease lease, boolean force) { - ReplicationGroupId groupId = lease.replicationGroupId(); - - LeaseAgreement agreement = leaseToNegotiate.get(groupId); + public void negotiate(LeaseAgreement agreement) { + Lease lease = agreement.getLease(); - assert agreement != null : "Lease agreement should exist when negotiation begins [groupId=" + groupId + "]."; + assert agreement != null : "Lease agreement should exist when negotiation begins [groupId=" + agreement.groupId() + "]."; Review Comment: I do not think that the assert has a sense; in considering you are using this variable a line above. -- 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