sanpwc commented on code in PR #3467:
URL: https://github.com/apache/ignite-3/pull/3467#discussion_r1547855735


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/PartitionListener.java:
##########
@@ -258,10 +262,18 @@ public void 
onWrite(Iterator<CommandClosure<WriteCommand>> iterator) {
      * @param commandIndex Index of the RAFT command.
      * @param commandTerm Term of the RAFT command.
      */
-    private void handleUpdateCommand(UpdateCommand cmd, long commandIndex, 
long commandTerm) {
+    private UpdateCommandResult handleUpdateCommand(UpdateCommand cmd, long 
commandIndex, long commandTerm) {
         // Skips the write command because the storage has already executed it.
         if (commandIndex <= storage.lastAppliedIndex()) {
-            return;
+            return new UpdateCommandResult(true);
+        }
+
+        if (cmd.leaseStartTime() != null) {
+            long leaseStartTime = requireNonNull(cmd.leaseStartTime(), 
"Inconsistent lease information in command [cmd=" + cmd + "].");
+
+            if (leaseStartTime != txStateStorage.leaseStartTime()) {

Review Comment:
   Are we going to read from the storage on every command with !=null 
leaseStartTime? Meaning retrieve page from the disk etc? I'd expect sort of 
caching as a PartitionListener field and actual retrieval from storage only on 
start. However, it's perfectly fine if such cashing is implemented on the 
storage side.



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