You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2023/02/02 10:21:13 UTC
[iotdb] branch beyyes/fix_cornor created (now 5e3d9dc16d)
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a change to branch beyyes/fix_cornor
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 5e3d9dc16d add logs for LACK_DATA_PARTITION_ALLOCATION and DiskSpaceWarningThreshold triggering
This branch includes the following new commits:
new 5e3d9dc16d add logs for LACK_DATA_PARTITION_ALLOCATION and DiskSpaceWarningThreshold triggering
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[iotdb] 01/01: add logs for LACK_DATA_PARTITION_ALLOCATION and DiskSpaceWarningThreshold triggering
Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch beyyes/fix_cornor
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5e3d9dc16d68e229fcb0d58faea85eeb2b92a005
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Thu Feb 2 18:20:57 2023 +0800
add logs for LACK_DATA_PARTITION_ALLOCATION and DiskSpaceWarningThreshold triggering
---
.../iotdb/confignode/manager/partition/PartitionManager.java | 10 +++++++++-
docs/UserGuide/Reference/Status-Codes.md | 1 +
docs/zh/UserGuide/Reference/Status-Codes.md | 5 +++--
.../db/service/thrift/impl/DataNodeInternalRPCServiceImpl.java | 4 ++++
.../src/main/java/org/apache/iotdb/rpc/TSStatusCode.java | 1 +
5 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
index 588b9c99f2..4127ba29d1 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java
@@ -315,7 +315,15 @@ public class PartitionManager {
}
}
- return (DataPartitionResp) getDataPartition(req);
+ resp = (DataPartitionResp) getDataPartition(req);
+ if (resp.isAllPartitionsExist()) {
+ LOGGER.error("");
+ resp.setStatus(
+ new TSStatus(TSStatusCode.LACK_DATA_PARTITION_ALLOCATION.getStatusCode())
+ .setMessage("Lacked some data partition allocation result in the response"));
+ return resp;
+ }
+ return resp;
}
// ======================================================
diff --git a/docs/UserGuide/Reference/Status-Codes.md b/docs/UserGuide/Reference/Status-Codes.md
index bb00b48de1..29bc191c85 100644
--- a/docs/UserGuide/Reference/Status-Codes.md
+++ b/docs/UserGuide/Reference/Status-Codes.md
@@ -133,6 +133,7 @@ Here is a list of Status Code and related message:
| 904 | CONSENSUS_NOT_INITIALIZED | Consensus is not initialized and cannot provide service |
| 905 | REGION_LEADER_CHANGE_ERROR | Region leader migration failed |
| 906 | NO_AVAILABLE_REGION_GROUP | Cannot find an available region group |
+| 907 | LACK_DATA_PARTITION_ALLOCATION | Lacked some data partition allocation result in the response |
| 1000 | DATANODE_ALREADY_REGISTERED | DataNode already registered in cluster |
| 1001 | NO_ENOUGH_DATANODE | The number of DataNode is not enough, cannot remove DataNode or create enough replication |
| 1002 | ADD_CONFIGNODE_ERROR | Add ConfigNode error |
diff --git a/docs/zh/UserGuide/Reference/Status-Codes.md b/docs/zh/UserGuide/Reference/Status-Codes.md
index 8d2847cec7..5d93f11fca 100644
--- a/docs/zh/UserGuide/Reference/Status-Codes.md
+++ b/docs/zh/UserGuide/Reference/Status-Codes.md
@@ -109,8 +109,8 @@ try {
| 711 | TSBLOCK_SERIALIZE_ERROR | TsBlock 序列化错误 |
| 712 | INTERNAL_REQUEST_TIME_OUT | MPP 操作超时 |
| 713 | INTERNAL_REQUEST_RETRY_ERROR | 内部操作重试失败 |
-| 714 | NO_SUCH_QUERY | 查询不存在 |
-| 715 | QUERY_WAS_KILLED | 查询执行时被终止 |
+| 714 | NO_SUCH_QUERY | 查询不存在 |
+| 715 | QUERY_WAS_KILLED | 查询执行时被终止 |
| 800 | UNINITIALIZED_AUTH_ERROR | 授权模块未初始化 |
| 801 | WRONG_LOGIN_PASSWORD | 用户名或密码错误 |
| 802 | NOT_LOGIN | 没有登录 |
@@ -134,6 +134,7 @@ try {
| 904 | CONSENSUS_NOT_INITIALIZED | 共识层未初始化,不能提供服务 |
| 905 | REGION_LEADER_CHANGE_ERROR | Region leader 迁移失败 |
| 906 | NO_AVAILABLE_REGION_GROUP | 无法找到可用的 Region 副本组 |
+| 907 | LACK_DATA_PARTITION_ALLOCATION | 调用创建数据分区方法的返回结果里缺少信息 |
| 1000 | DATANODE_ALREADY_REGISTERED | DataNode 在集群中已经注册 |
| 1001 | NO_ENOUGH_DATANODE | DataNode 数量不足,无法移除节点或创建副本 |
| 1002 | ADD_CONFIGNODE_ERROR | 新增 ConfigNode 失败 |
diff --git a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeInternalRPCServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeInternalRPCServiceImpl.java
index c6b14c2b52..98b250467a 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeInternalRPCServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/thrift/impl/DataNodeInternalRPCServiceImpl.java
@@ -1076,6 +1076,10 @@ public class DataNodeInternalRPCServiceImpl implements IDataNodeRPCService.Iface
loadSample.setDiskUsageRate(1.0 - freeDiskRatio);
// Reset NodeStatus if necessary
if (freeDiskRatio < commonConfig.getDiskSpaceWarningThreshold()) {
+ LOGGER.warn(
+ "The remaining disk usage ratio:{} is less than disk_spec_warning_threshold:{}, set system to readonly!",
+ freeDiskRatio,
+ commonConfig.getDiskSpaceWarningThreshold());
commonConfig.setNodeStatus(NodeStatus.ReadOnly);
commonConfig.setStatusReason(NodeStatus.DISK_FULL);
}
diff --git a/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java b/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
index 4c5519c19b..dc985b5f38 100644
--- a/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
+++ b/service-rpc/src/main/java/org/apache/iotdb/rpc/TSStatusCode.java
@@ -136,6 +136,7 @@ public enum TSStatusCode {
CONSENSUS_NOT_INITIALIZED(904),
REGION_LEADER_CHANGE_ERROR(905),
NO_AVAILABLE_REGION_GROUP(906),
+ LACK_DATA_PARTITION_ALLOCATION(907),
// Cluster Manager
ADD_CONFIGNODE_ERROR(1000),