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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/PartitionListener.java:
##########
@@ -194,6 +208,27 @@ public PartitionListener(
         }
     }
 
+    private boolean shouldApplyLog(boolean isFull, LeaseInfo storageLeaseInfo) 
{
+        if (isFull) {
+            return true;
+        }
+
+        HybridTimestamp currentTime = clockService.current();
+
+        if (lastKnownLease == null || 
lastKnownLease.getExpirationTime().compareTo(currentTime) < 0) {
+            ReplicationGroupId groupId = new 
TablePartitionId(storage.tableId(), storage.partitionId());
+            lastKnownLease = placementDriver.getCurrentPrimaryReplica(groupId, 
currentTime);
+        }
+
+        if (lastKnownLease == null
+                || !lastKnownLease.getLeaseholderId().equals(localNodeId)
+                || lastKnownLease.getExpirationTime().compareTo(currentTime) < 
0) {

Review Comment:
   The last check is excessive because it is already done in getCurrentPrimary 
method.



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/PartitionListener.java:
##########
@@ -194,6 +208,27 @@ public PartitionListener(
         }
     }
 
+    private boolean shouldApplyLog(boolean isFull, LeaseInfo storageLeaseInfo) 
{

Review Comment:
   It is a workflow of log updates. Could it be changed to something more 
specific, for example: `shouldUpdateStorage`



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

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

Reply via email to