Lalant commented on code in PR #7769:
URL: https://github.com/apache/ignite-3/pull/7769#discussion_r2939997168
##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/LeaseUpdater.java:
##########
@@ -486,11 +486,33 @@ private void updateLeaseBatchInternal() {
: lease.proposedCandidate();
InternalClusterNode candidate =
nextLeaseHolder(stableAssignments, pendingAssignments, grpId,
proposedLeaseholder);
+ boolean leaseholderIdIsInLogicalTopology =
lease.getLeaseholderId() != null
+ &&
topologyTracker.containsNodeId(lease.getLeaseholderId());
+ boolean hasStaleLeaseholderId = lease.isAccepted() &&
!leaseholderIdIsInLogicalTopology;
boolean canBeProlonged = lease.isAccepted()
&& lease.isProlongable()
+ && !hasStaleLeaseholderId
&& candidate != null &&
candidate.id().equals(lease.getLeaseholderId());
+ if (hasStaleLeaseholderId) {
+ LOG.info("Leaseholder has left the logical topology,
creating a new lease [groupId={}, lease={}, candidate={}]",
+ grpId, lease, candidate);
+
+ if (candidate == null) {
+ logGroupWithoutCandidateOnce(grpId, true,
stableAssignments, pendingAssignments);
+ continue;
+ }
+
+ Lease newLease = writeNewLease(grpId, candidate,
renewedLeases);
+
+ boolean force = Objects.equals(lease.getLeaseholder(),
candidate.name());
+
+ toBeNegotiated.put(grpId, new LeaseAgreement(newLease,
force));
+
+ continue;
+ }
+
Review Comment:
I can, but that leaves a known-stale lease published longer than necessary.
--
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]