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/01/18 07:19:16 UTC

[iotdb] branch master updated: [IOTDB-5429] Disable first election in RatisConsensus UT to avoid inconsistency states (#8896)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new deb848a968 [IOTDB-5429] Disable first election in RatisConsensus UT to avoid inconsistency states (#8896)
deb848a968 is described below

commit deb848a96810a2ab673e6870da519c01b4f07d80
Author: William Song <48...@users.noreply.github.com>
AuthorDate: Wed Jan 18 15:19:10 2023 +0800

    [IOTDB-5429] Disable first election in RatisConsensus UT to avoid inconsistency states (#8896)
---
 .../java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
index ea38b15115..cb86a0f79d 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
@@ -34,6 +34,7 @@ import org.apache.iotdb.consensus.config.RatisConfig;
 import org.apache.iotdb.consensus.exception.RatisRequestFailedException;
 
 import org.apache.ratis.util.FileUtils;
+import org.apache.ratis.util.TimeDuration;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -76,6 +77,13 @@ public class RatisConsensusTest {
                       .setAutoTriggerThreshold(100)
                       .setCreationGap(10)
                       .build())
+              .setRpc(
+                  RatisConfig.Rpc.newBuilder()
+                      .setFirstElectionTimeoutMin(TimeDuration.valueOf(1, TimeUnit.SECONDS))
+                      .setFirstElectionTimeoutMax(TimeDuration.valueOf(4, TimeUnit.SECONDS))
+                      .setTimeoutMin(TimeDuration.valueOf(1, TimeUnit.SECONDS))
+                      .setTimeoutMax(TimeDuration.valueOf(4, TimeUnit.SECONDS))
+                      .build())
               .setImpl(
                   RatisConfig.Impl.newBuilder()
                       .setTriggerSnapshotFileSize(1)