You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/06/14 11:20:25 UTC

[GitHub] [iotdb] qiaojialin commented on a diff in pull request #6277: [IOTDB-3485] Insert with wrong type didn't return error massage

qiaojialin commented on code in PR #6277:
URL: https://github.com/apache/iotdb/pull/6277#discussion_r896693352


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java:
##########
@@ -201,20 +201,30 @@ private boolean dispatchLocally(FragmentInstance instance)
         return !((FragmentInstanceInfo) readResponse.getDataset()).getState().isFailed();
       case WRITE:
         PlanNode planNode = instance.getFragment().getRoot();
+        boolean hasFailedMeasurement = false;
         if (planNode instanceof InsertNode) {
+          InsertNode insertNode = (InsertNode) planNode;
           try {
-            SchemaValidator.validate((InsertNode) planNode);
+            SchemaValidator.validate(insertNode);
           } catch (SemanticException e) {
             throw new FragmentInstanceDispatchException(e);
           }
+          hasFailedMeasurement = insertNode.hasFailedMeasurements();
+          if (hasFailedMeasurement) {
+            logger.warn(
+                "Fail to insert measurements {} caused by {}",

Review Comment:
   log the deviceId and timestamp



##########
server/src/main/java/org/apache/iotdb/db/service/thrift/impl/InternalServiceImpl.java:
##########
@@ -144,14 +144,23 @@ public TSendPlanNodeResp sendPlanNode(TSendPlanNodeReq req) {
     ConsensusWriteResponse writeResponse;
 
     PlanNode planNode = PlanNodeType.deserialize(req.planNode.body);
+    boolean hasFailedMeasurement = false;
     if (planNode instanceof InsertNode) {
+      InsertNode insertNode = (InsertNode) planNode;
       try {
-        SchemaValidator.validate((InsertNode) planNode);
+        SchemaValidator.validate(insertNode);
       } catch (SemanticException e) {
         response.setAccepted(false);
         response.setMessage(e.getMessage());
         return response;
       }
+      hasFailedMeasurement = insertNode.hasFailedMeasurements();
+      if (hasFailedMeasurement) {
+        LOGGER.warn(
+            "Fail to insert measurements {} caused by {}",

Review Comment:
   better to print the deviceId and timestamp also, which help locate problem



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org