You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/07/14 03:39:27 UTC
[iotdb] branch xingtanzjr/query_retry updated: fix the issues both in confignode and QueryExecution
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch xingtanzjr/query_retry
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/xingtanzjr/query_retry by this push:
new 096bf007c3 fix the issues both in confignode and QueryExecution
096bf007c3 is described below
commit 096bf007c31a208db7be922eb9f8bb23aa2f14b4
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Thu Jul 14 11:39:18 2022 +0800
fix the issues both in confignode and QueryExecution
---
.../confignode/manager/load/heartbeat/DataNodeHeartbeatCache.java | 5 +++++
.../org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/heartbeat/DataNodeHeartbeatCache.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/heartbeat/DataNodeHeartbeatCache.java
index a836a6d2e2..d230543694 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/heartbeat/DataNodeHeartbeatCache.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/heartbeat/DataNodeHeartbeatCache.java
@@ -68,6 +68,11 @@ public class DataNodeHeartbeatCache implements INodeCache {
}
}
+ /* Update loadScore */
+ if (lastSendTime > 0) {
+ loadScore = -lastSendTime;
+ }
+
NodeStatus originStatus;
switch (status) {
case Running:
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java
index a503a92999..0225d403eb 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/QueryExecution.java
@@ -88,6 +88,7 @@ public class QueryExecution implements IQueryExecution {
private static final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
private static final int MAX_RETRY_COUNT = 3;
+ private static final long RETRY_INTERVAL_IN_MS = 2000;
private int retryCount = 0;
private final MPPQueryContext context;
private IScheduler scheduler;
@@ -182,6 +183,12 @@ public class QueryExecution implements IQueryExecution {
stateMachine.transitionToFailed();
return;
}
+ try {
+ Thread.sleep(RETRY_INTERVAL_IN_MS);
+ } catch (InterruptedException e) {
+ logger.error("interrupted when waiting retry");
+ Thread.currentThread().interrupt();
+ }
retryCount++;
logger.error("error when executing query. {}", stateMachine.getFailureMessage());
logger.warn("start to retry. Retry count is: {}", retryCount);