This is an automated email from the ASF dual-hosted git repository.

haonan 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 7dc11bae56 [IOTDB-4493] Fix null message in TSStatus (#7402)
7dc11bae56 is described below

commit 7dc11bae567cb6aac18827b5c746e84538538ac3
Author: ZhangHongYin <[email protected]>
AuthorDate: Thu Sep 22 23:36:17 2022 +0800

    [IOTDB-4493] Fix null message in TSStatus (#7402)
---
 .../iotdb/confignode/manager/partition/PartitionManager.java      | 8 ++++++--
 .../apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java | 4 +++-
 2 files changed, 9 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 8244f38ce7..5a81ffdf6c 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
@@ -352,11 +352,15 @@ public class PartitionManager {
         result = RpcUtils.SUCCESS_STATUS;
       }
     } catch (NotEnoughDataNodeException e) {
-      LOGGER.error("ConfigNode failed to extend Region because there are not 
enough DataNodes");
+      String prompt = "ConfigNode failed to extend Region because there are 
not enough DataNodes";
+      LOGGER.error(prompt);
       result.setCode(TSStatusCode.NOT_ENOUGH_DATA_NODE.getStatusCode());
+      result.setMessage(prompt);
     } catch (StorageGroupNotExistsException e) {
-      LOGGER.error("ConfigNode failed to extend Region because some 
StorageGroup doesn't exist.");
+      String prompt = "ConfigNode failed to extend Region because some 
StorageGroup doesn't exist.";
+      LOGGER.error(prompt);
       result.setCode(TSStatusCode.STORAGE_GROUP_NOT_EXIST.getStatusCode());
+      result.setMessage(prompt);
     }
 
     return result;
diff --git 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
index 0488daf658..1b45b3c45b 100644
--- 
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
+++ 
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java
@@ -127,7 +127,9 @@ public class MultiLeaderServerImpl {
               !stateMachineCondition.await(
                   config.getReplication().getThrottleTimeOutMs(), 
TimeUnit.MILLISECONDS);
           if (timeout) {
-            return RpcUtils.getStatus(TSStatusCode.WRITE_PROCESS_REJECT);
+            return RpcUtils.getStatus(
+                TSStatusCode.WRITE_PROCESS_REJECT,
+                "Reject write because there are too many requests need to 
process");
           }
         } catch (InterruptedException e) {
           logger.error("Failed to throttle down because ", e);

Reply via email to