This is an automated email from the ASF dual-hosted git repository.
JackieTien97 pushed a commit to branch rc/2.0.11
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rc/2.0.11 by this push:
new b8265e3ddbc modify the deal strategy for metadata lease exception in
DataDriver and ErrorHandlingUtils (#18438)
b8265e3ddbc is described below
commit b8265e3ddbc971a38ee7ff47c897bcd5792d03df
Author: CYB <[email protected]>
AuthorDate: Thu Aug 27 10:36:09 2026 +0800
modify the deal strategy for metadata lease exception in DataDriver and
ErrorHandlingUtils (#18438)
---
.../db/queryengine/execution/driver/DataDriver.java | 20 +++++++++++++++-----
.../apache/iotdb/db/utils/ErrorHandlingUtils.java | 5 ++++-
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/driver/DataDriver.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/driver/DataDriver.java
index 6b129549b09..c8612d9b563 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/driver/DataDriver.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/driver/DataDriver.java
@@ -21,7 +21,9 @@ package org.apache.iotdb.db.queryengine.execution.driver;
import org.apache.iotdb.calc.exception.QueryProcessException;
import org.apache.iotdb.calc.execution.operator.Operator;
+import org.apache.iotdb.commons.exception.MetadataLeaseFencedException;
import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
+import org.apache.iotdb.db.i18n.DataNodeSchemaMessages;
import
org.apache.iotdb.db.queryengine.execution.operator.source.DataSourceOperator;
import org.apache.iotdb.db.queryengine.plan.planner.plan.FragmentInstance;
import org.apache.iotdb.db.storageengine.dataregion.read.IQueryDataSource;
@@ -65,21 +67,29 @@ public class DataDriver extends Driver {
} else {
return true;
}
+ } catch (MetadataLeaseFencedException e) {
+ LOGGER.info(
+ DataNodeSchemaMessages.METADATA_LEASE_IS_FENCED,
driverContext.getDriverTaskID(), e);
+ handleInitFailure(e, blockedFuture);
} catch (Throwable t) {
LOGGER.error(
DataNodeQueryMessages.FAILED_TO_DO_THE_INITIALIZATION_FOR_DRIVER_ARG,
driverContext.getDriverTaskID(),
t);
- driverContext.failed(t);
- blockedFuture.setException(t);
- throwIfUnchecked(t);
- // should never happen
- throw new AssertionError(t);
+ handleInitFailure(t, blockedFuture);
}
}
return true;
}
+ private void handleInitFailure(Throwable t, SettableFuture<?> blockedFuture)
{
+ driverContext.failed(t);
+ blockedFuture.setException(t);
+ throwIfUnchecked(t);
+ // should never happen
+ throw new AssertionError(t);
+ }
+
@Override
public boolean isInit() {
return init;
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
index bbe30acba01..b50043724a4 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ErrorHandlingUtils.java
@@ -135,7 +135,10 @@ public class ErrorHandlingUtils {
|| status.getCode() ==
TSStatusCode.PATH_ALREADY_EXIST.getStatusCode()
|| status.getCode() ==
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode()
|| status.getCode() == TSStatusCode.QUERY_TIMEOUT.getStatusCode()
- || status.getCode() ==
TSStatusCode.CANNOT_READ_TSFILE.getStatusCode()) {
+ || status.getCode() ==
TSStatusCode.CANNOT_READ_TSFILE.getStatusCode()
+ || status.getCode() ==
TSStatusCode.METADATA_LEASE_FENCED.getStatusCode()
+ || status.getCode()
+ ==
TSStatusCode.METADATA_LEASE_FENCED_RETRY_REQUIRED.getStatusCode()) {
LOGGER.info(message);
} else {
LOGGER.warn(message, e);