denis-chudov commented on code in PR #3422:
URL: https://github.com/apache/ignite-3/pull/3422#discussion_r1526527476


##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/leases/LeaseTracker.java:
##########
@@ -99,14 +101,21 @@ public class LeaseTracker extends 
AbstractEventProducer<PrimaryReplicaEvent, Pri
     /** Cluster node resolver. */
     private final ClusterNodeResolver clusterNodeResolver;
 
+    private final Function<ReplicationGroupId, 
CompletableFuture<ReplicationGroupId>> groupIdProvider;
+
     /**
      * Constructor.
      *
      * @param msManager Meta storage manager.
      */
-    public LeaseTracker(MetaStorageManager msManager, ClusterNodeResolver 
clusterNodeResolver) {
+    public LeaseTracker(
+            MetaStorageManager msManager,
+            ClusterNodeResolver clusterNodeResolver,
+            Function<ReplicationGroupId, 
CompletableFuture<ReplicationGroupId>> groupIdProvider

Review Comment:
   its not obvious what does this provider provide, I can only guess



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java:
##########
@@ -86,6 +86,10 @@ public class Replica {
 
     private final PlacementDriver placementDriver;
 
+    private final HybridClock clock;
+
+    private final CompletableFuture<Void> waitForActualStateFuture = new 
CompletableFuture<>();

Review Comment:
   You can't have a single future here.
   "Actual state" is the state of being caught up with the group leader. When 
the replica is accepting the lease, it requests the index from the group leader 
first, and wait for the local storage to reach that index. Only after that it 
can accept the lease and become a valid leaseholder that is up-to-date with the 
group leader. So the actual state is different every time when a lease is 
granted to the replica, and the future of waiting this state should be 
different as well.



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