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


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -210,16 +217,35 @@ public void run() {
 
                     Lease lease = leaseTracker.getLease(grpId);
 
+                    if (!lease.isAccepted()) {
+                        LeaseAgreement agreement = 
leaseNegotiator.negotiated(grpId);
+
+                        if (agreement.isAccepted()) {
+                            publishLease(grpId, lease);
+
+                            continue;
+                        } else if (agreement.ready()) {
+                            ClusterNode candidate = 
nextLeaseHolder(entry.getValue(), agreement.getRedirectTo());
+
+                            if (candidate == null) {
+                                continue;
+                            }
+
+                            // New lease is granting.
+                            writeNewLeasInMetaStorage(grpId, lease, candidate);

Review Comment:
   New lease is written to MS as unacceptable. When the new lease wrote, a 
negotiation procedure is started.
   Only when the lease is accepted by replica side, it will be written to MS as 
an accepted lease.
   The only place where a lease can be accepted is Updater#publishLease.
   All of these steps are valid for a redirect proposal 
(agreement.getRedirectTo).



-- 
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]

Reply via email to