You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "vldpyatkov (via GitHub)" <gi...@apache.org> on 2023/05/02 13:14:53 UTC

[GitHub] [ignite-3] vldpyatkov commented on a diff in pull request #2003: IGNITE-19390 Handling lease deny message in placement driver side

vldpyatkov commented on code in PR #2003:
URL: https://github.com/apache/ignite-3/pull/2003#discussion_r1182531187


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/leases/Lease.java:
##########
@@ -95,7 +111,20 @@ public Lease acceptLease(HybridTimestamp to) {
                 + "leaseholder=" + leaseholder
                 + ", expirationTime=" + expirationTime + ']';
 
-        return new Lease(leaseholder, startTime, to, true);
+        return new Lease(leaseholder, startTime, to, true, true);
+    }
+
+    /**
+     * Denies the lease.
+     *
+     * @return Denied lease.
+     */
+    public Lease denyLease() {
+        assert accepted : "The lease is not accepted ["
+                + "leaseholder=" + leaseholder
+                + ", expirationTime=" + expirationTime + ']';
+
+        return new Lease(leaseholder, startTime, expirationTime, false, true);

Review Comment:
   Accepted lease means we cannot change their expiration timestamp. Moreover, it is worth to refers to accepted flag like a storage marker (all leases with accepted flag are available for placement driver, but not available for other nodes). And here we shouldn't to remove an active lease (not expired) from one storage, because it should be available for all until their time is not elapsed.



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org