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


##########
modules/raft-api/src/main/java/org/apache/ignite/internal/raft/Command.java:
##########
@@ -17,10 +17,27 @@
 
 package org.apache.ignite.internal.raft;
 
+import org.apache.ignite.internal.hlc.HybridTimestamp;
 import org.apache.ignite.internal.network.NetworkMessage;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * A marker interface for replication group command.
  */
 public interface Command extends NetworkMessage {
+    /**
+     * This is called before a command is submitted to replication pipeline.
+     *
+     * @param safeTs Safe timestamp.
+     */
+    default void patch(HybridTimestamp safeTs) {}
+
+    /**
+     * Holds request's initiator timestamp.
+     *
+     * @return The timestamp.
+     */
+    default @Nullable HybridTimestamp initiatorTime() {

Review Comment:
   1. Do we ever set initiatorTime to any ReadCommand?
   2. Is it ever valid not to provide initiatorTime to corresponding commands 
in case of jraft?
   
   > this is nullable because this field is optional (protocol dependent).
   
   Are we going to have anything besides jraft in nearest future (say a year)? 
If not I'd rather remove @Nullable, because otherwise we may forget to set the 
value while using jraft.
   
   > but it will always be not null for raft + writecommand.
   
   Why `HybridTimestamp initiatorTime()` is not in WriteCommand in that case?
   BTW, do you mean that every WriteCommand should be initiatorTime aware?



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