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 2021/07/12 19:53:19 UTC

[GitHub] [iotdb] cmlmakahts commented on a change in pull request #3474: [IOTDB-1456] Fix Error occurred while executing delete timeseries statement

cmlmakahts commented on a change in pull request #3474:
URL: https://github.com/apache/iotdb/pull/3474#discussion_r667984081



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/log/applier/BaseApplier.java
##########
@@ -102,6 +104,16 @@ private void handleBatchProcessException(BatchProcessException e, PhysicalPlan p
           && plan instanceof BatchPlan) {
         ((BatchPlan) plan).setIsExecuted(i);
       }
+
+      if (plan instanceof DeleteTimeSeriesPlan) {
+        if (status != null && status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+          if (status.getCode() != TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode()) {
+            logger.info("{} doesn't exist, it may has been deleted.", plan.getPaths().get(i));
+          } else {
+            needThrow = true;

Review comment:
       1. First mistake has been modified.(status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode())
   2.Delete operation won't be performed once again, but if exeception is thrown directly here, batch exception won't be catched correctly in coordinator.
   ![image](https://user-images.githubusercontent.com/82880298/125305384-e26b9900-e360-11eb-9356-59e80adbb2f4.png)
   

##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/log/applier/BaseApplier.java
##########
@@ -102,6 +104,16 @@ private void handleBatchProcessException(BatchProcessException e, PhysicalPlan p
           && plan instanceof BatchPlan) {
         ((BatchPlan) plan).setIsExecuted(i);
       }
+
+      if (plan instanceof DeleteTimeSeriesPlan) {
+        if (status != null && status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+          if (status.getCode() != TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode()) {
+            logger.info("{} doesn't exist, it may has been deleted.", plan.getPaths().get(i));
+          } else {
+            needThrow = true;

Review comment:
       1. First mistake has been modified.(status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode())
   
   2.Delete operation won't be performed once again, but if exeception is thrown directly here, batch exception won't be catched correctly in coordinator.
   ![image](https://user-images.githubusercontent.com/82880298/125305384-e26b9900-e360-11eb-9356-59e80adbb2f4.png)
   

##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/log/applier/BaseApplier.java
##########
@@ -102,6 +104,16 @@ private void handleBatchProcessException(BatchProcessException e, PhysicalPlan p
           && plan instanceof BatchPlan) {
         ((BatchPlan) plan).setIsExecuted(i);
       }
+
+      if (plan instanceof DeleteTimeSeriesPlan) {
+        if (status != null && status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+          if (status.getCode() != TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode()) {
+            logger.info("{} doesn't exist, it may has been deleted.", plan.getPaths().get(i));
+          } else {
+            needThrow = true;

Review comment:
       1. First mistake has been modified.(status.getCode() == TSStatusCode.TIMESERIES_NOT_EXIST.getStatusCode())
   
   2.Delete operation won't be performed once again, but if exeception is thrown directly here, batch exception won't be catched in coordinator that leads to the error mentioned in the issue.
   
   ![image](https://user-images.githubusercontent.com/82880298/125306176-90774300-e361-11eb-9792-2443e5178ce0.png)
   
   
   




-- 
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