denis-chudov commented on code in PR #4329:
URL: https://github.com/apache/ignite-3/pull/4329#discussion_r1755275285
##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/leases/Lease.java:
##########
@@ -153,10 +151,10 @@ public Lease acceptLease(HybridTimestamp to) {
*
* @return Denied lease.
*/
- public Lease denyLease(String proposedCandidate) {
- assert accepted : "The lease is not accepted: " + this;
+ public Lease denyLease(@Nullable String proposedCandidate) {
+ HybridTimestamp newExpirationTime = accepted ? expirationTime : new
HybridTimestamp(System.currentTimeMillis(), 0);
- return new Lease(leaseholder, leaseholderId, startTime,
expirationTime, false, true, proposedCandidate, replicationGroupId);
+ return new Lease(leaseholder, leaseholderId, startTime,
newExpirationTime, false, accepted, proposedCandidate, replicationGroupId);
Review Comment:
We can't do this: replica must accept the lease and send
LeaseGrantMessageResponse before that. Otherwise we can grant the accepted
lease to replica that could not have caught up yet.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]