This is an automated email from the ASF dual-hosted git repository. tanxinyu pushed a commit to branch ratis_linearizable_read in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit ccbbcf7daa0b9c382d5b6a8c2c1725eec08c777a Author: OneSizeFitQuorum <[email protected]> AuthorDate: Thu Jan 18 11:38:45 2024 +0800 finish Signed-off-by: OneSizeFitQuorum <[email protected]> --- .../main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java index 07f3236735f..df1ada5b7c5 100644 --- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java +++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java @@ -156,7 +156,11 @@ class RatisConsensus implements IConsensus { this.ratisMetricSet = new RatisMetricSet(); this.readRetryPolicy = RetryPolicy.<RaftClientReply>newBuilder() - .setRetryHandler(c -> !c.isSuccess() && c.getException() instanceof ReadIndexException) + .setRetryHandler( + c -> + !c.isSuccess() + && (c.getException() instanceof ReadIndexException + || c.getException() instanceof NotLeaderException)) .setMaxAttempts(this.config.getImpl().getRetryTimesMax()) .setWaitTime( TimeDuration.valueOf(
