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


##########
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) {}

Review Comment:
   The concept of patching the command isn't actually good. Meaning that 
command becomes mutable and thus not-thread safe. Let's say on the replica 
side, within one of the replica's threads ,UpdateAllCommand was created a bit 
later, exactly that command was patched with some other in-raft thread. Without 
extra synchronization, replica won't see proposed safeTime. Basically, it's 
quite fragile.



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