ibessonov commented on code in PR #3470:
URL: https://github.com/apache/ignite-3/pull/3470#discussion_r1537421681


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/configuration/SchemaSynchronizationConfigurationSchema.java:
##########
@@ -32,7 +33,16 @@
 public class SchemaSynchronizationConfigurationSchema {
     /** Delay Duration (ms), see the spec for details. */
     @Value(hasDefault = true)
-    @Range(min = 0)
-    // TODO: IGNITE-19792 - make @Immutable when it gets being handled 
property for distributed config.
+    @Range(min = 1)
+    @Immutable
     public long delayDuration = TimeUnit.SECONDS.toMillis(1);
+
+    /**
+     * Max physical clock skew (ms) that is tolerated by the cluster. If 
difference between physical clocks of 2 nodes of a cluster
+     * exceeds this value, the cluster might demonstrate abnormal behavior.
+     */
+    @Value(hasDefault = true)
+    @Range(min = 1)
+    @Immutable
+    public long maxClockSkew = 500;

Review Comment:
   Any specific source for this default value?



##########
modules/replicator/src/main/java/org/apache/ignite/internal/replicator/Replica.java:
##########
@@ -104,26 +108,20 @@ public Replica(
             TopologyAwareRaftGroupService raftClient,
             ClusterNode localNode,
             ExecutorService executor,
-            PlacementDriver placementDriver
-    ) {
+            PlacementDriver placementDriver,
+            ClockService clockService) {

Review Comment:
   ```suggestion
               ClockService clockService
       ) {
   ```



##########
modules/runner/src/main/java/org/apache/ignite/internal/app/IgniteImpl.java:
##########
@@ -569,6 +573,12 @@ public class IgniteImpl implements Ignite {
 
         
metaStorageMgr.configure(clusterConfigRegistry.getConfiguration(MetaStorageConfiguration.KEY));
 
+        SchemaSynchronizationConfiguration schemaSyncConfig = 
clusterConfigRegistry.getConfiguration(
+                SchemaSynchronizationConfiguration.KEY
+        );
+
+        clockService = new ClockServiceImpl(clock, clockWaiter, new 
SameValueLongSupplier(() -> schemaSyncConfig.maxClockSkew().value()));

Review Comment:
   Why is it immutable though?



##########
modules/core/src/main/java/org/apache/ignite/internal/hlc/ClockWaiter.java:
##########
@@ -49,7 +46,7 @@
  * no SafeTime mechanisms are involved.
  */
 public class ClockWaiter implements IgniteComponent {
-    private static final IgniteLogger LOG = 
Loggers.forClass(ClockWaiter.class);
+    private final IgniteLogger log = Loggers.forClass(ClockWaiter.class);

Review Comment:
   Ok, but why? Does this have something to do with thin clients?



##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -881,7 +880,7 @@ private long observableTimestamp(@Nullable 
ClientMessagePacker out) {
             }
         }
 
-        return clock.now().longValue();
+        return clockService.now().longValue();

Review Comment:
   I believe that I saw `nowLong()` somewhere, it's preferable



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