You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/10/30 04:52:05 UTC

(iotdb) 01/01: fix

This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch slowness_infinity
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 9b32dc03d31762d62dff9b8766d158c2b8334330
Author: OneSizeFitQuorum <ta...@apache.org>
AuthorDate: Mon Oct 30 12:49:36 2023 +0800

    fix
    
    Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
 .../main/java/org/apache/iotdb/consensus/config/RatisConfig.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/config/RatisConfig.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/config/RatisConfig.java
index e8bde5d2252..693265cef55 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/config/RatisConfig.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/config/RatisConfig.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.client.property.ClientPoolProperty.DefaultProper
 
 import org.apache.ratis.grpc.GrpcConfigKeys.Server;
 import org.apache.ratis.server.RaftServerConfigKeys;
+import org.apache.ratis.server.RaftServerConfigKeys.LeaderElection;
 import org.apache.ratis.util.SizeInBytes;
 import org.apache.ratis.util.TimeDuration;
 
@@ -267,7 +268,13 @@ public class RatisConfig {
       private TimeDuration timeoutMax = TimeDuration.valueOf(4, TimeUnit.SECONDS);
       private TimeDuration requestTimeout = TimeDuration.valueOf(20, TimeUnit.SECONDS);
       private TimeDuration sleepTime = TimeDuration.valueOf(1, TimeUnit.SECONDS);
-      private TimeDuration slownessTimeout = TimeDuration.valueOf(3, TimeUnit.DAYS);
+      /**
+       * TODO: After introducing version 3.0 of Ratis, we plan to reduce the value of this parameter
+       * because a new parameter will be introduced later. For more details, please refer to `<a
+       * href="https://lists.apache.org/thread/vxd97lpllqtdb8cdbt3nxvg1kv6kjfss">email</a>`. It is
+       * set to 100 years instead of Long.MAX_VALUE to avoid potential overflows when shifting time.
+       */
+      private TimeDuration slownessTimeout = TimeDuration.valueOf(100 * 365, TimeUnit.DAYS);
 
       private TimeDuration firstElectionTimeoutMin =
           TimeDuration.valueOf(50, TimeUnit.MILLISECONDS);