This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch rc/1.3.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rc/1.3.3 by this push:
new b45cc70fb02 [region migration] Catch Ratis Read InterruptedException
#13612 (#13625)
b45cc70fb02 is described below
commit b45cc70fb0207a0303600899d2f33af53ca63835
Author: Xiangpeng Hu <[email protected]>
AuthorDate: Wed Sep 25 21:47:19 2024 +0800
[region migration] Catch Ratis Read InterruptedException #13612 (#13625)
(cherry picked from commit 3140521f5488d2adf24eb5fcabc6b9250dccee2a)
---
.../src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java | 3 +++
.../iotdb/db/queryengine/execution/executor/RegionReadExecutor.java | 3 ++-
2 files 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 85786cc7087..9115c28cc8b 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
@@ -390,6 +390,9 @@ class RatisConsensus implements IConsensus {
} else {
throw new RatisRequestFailedException(e);
}
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new RatisReadUnavailableException(e);
} catch (Exception e) {
throw new RatisRequestFailedException(e);
}
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionReadExecutor.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionReadExecutor.java
index 68ee5352cf0..b045babc6d6 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionReadExecutor.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/executor/RegionReadExecutor.java
@@ -118,7 +118,8 @@ public class RegionReadExecutor {
if (t instanceof ReadException
|| t instanceof ReadIndexException
|| t instanceof NotLeaderException
- || t instanceof ServerNotReadyException) {
+ || t instanceof ServerNotReadyException
+ || t instanceof InterruptedException) {
resp.setReadNeedRetry(true);
resp.setStatus(new
TSStatus(TSStatusCode.RATIS_READ_UNAVAILABLE.getStatusCode()));
}