This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new c83d8c814d Add logs for LACK_DATA_PARTITION_ALLOCATION and
DiskSpaceWarningThreshold triggering (#8968)
c83d8c814d is described below
commit c83d8c814d8644ea1b8197e4b183368a70028e44
Author: Beyyes <[email protected]>
AuthorDate: Tue Feb 7 11:21:58 2023 +0800
Add logs for LACK_DATA_PARTITION_ALLOCATION and DiskSpaceWarningThreshold
triggering (#8968)
---
.../iotdb/confignode/manager/partition/PartitionManager.java | 11 ++++++++++-
docs/UserGuide/Reference/Status-Codes.md | 1 +
docs/zh/UserGuide/Reference/Status-Codes.md | 5 +++--
.../service/thrift/impl/DataNodeInternalRPCServiceImpl.java | 4 ++++
.../src/main/java/org/apache/iotdb/rpc/TSStatusCode.java | 1 +
5 files changed, 19 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..279d017fa0 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,16 @@ public class PartitionManager {
}
}
- return (DataPartitionResp) getDataPartition(req);
+ resp = (DataPartitionResp) getDataPartition(req);
+ if (!resp.isAllPartitionsExist()) {
+ LOGGER.error(
+ "Lacked some data partition allocation result in the response of
getOrCreateDataPartition method");
+ 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),