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/03/15 04:13:01 UTC

[GitHub] [iotdb] cigarl opened a new pull request #5235: ttl cannot be set if storage group is not exist

cigarl opened a new pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235


   <img width="267" alt="1647317336" src="https://user-images.githubusercontent.com/44458757/158304597-ad0079f6-f3ff-41bf-b8e1-955f0d3284fc.png">
   
   We should tell the user that they are using the wrong storage group,then let them troubleshoot the 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



[GitHub] [iotdb] wangchao316 commented on a change in pull request #5235: [IOTDB-2743] ttl cannot be set if storage group is not exist

Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235#discussion_r826694310



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1496,14 +1496,20 @@ private void operateUnloadFile(OperateFilePlan plan) throws QueryProcessExceptio
     }
   }
 
-  private void operateTTL(SetTTLPlan plan) throws QueryProcessException {
+  private void operateTTL(SetTTLPlan plan)
+      throws QueryProcessException, StorageGroupNotSetException {
     try {
       List<PartialPath> storageGroupPaths =
           IoTDB.metaManager.getMatchedStorageGroups(plan.getStorageGroup(), plan.isPrefixMatch());
+      if (storageGroupPaths.isEmpty()) {
+        throw new StorageGroupNotSetException(plan.getStorageGroup().getFullPath());
+      }
       for (PartialPath storagePath : storageGroupPaths) {
         IoTDB.metaManager.setTTL(storagePath, plan.getDataTTL());
         StorageEngine.getInstance().setTTL(storagePath, plan.getDataTTL());
       }
+    } catch (StorageGroupNotSetException e) {
+      throw e;

Review comment:
       ok




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



[GitHub] [iotdb] cigarl closed pull request #5235: [IOTDB-2743] ttl cannot be set if storage group is not exist

Posted by GitBox <gi...@apache.org>.
cigarl closed pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235


   


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



[GitHub] [iotdb] cigarl commented on a change in pull request #5235: [IOTDB-2743] ttl cannot be set if storage group is not exist

Posted by GitBox <gi...@apache.org>.
cigarl commented on a change in pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235#discussion_r826684447



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1496,14 +1496,20 @@ private void operateUnloadFile(OperateFilePlan plan) throws QueryProcessExceptio
     }
   }
 
-  private void operateTTL(SetTTLPlan plan) throws QueryProcessException {
+  private void operateTTL(SetTTLPlan plan)
+      throws QueryProcessException, StorageGroupNotSetException {
     try {
       List<PartialPath> storageGroupPaths =
           IoTDB.metaManager.getMatchedStorageGroups(plan.getStorageGroup(), plan.isPrefixMatch());
+      if (storageGroupPaths.isEmpty()) {
+        throw new StorageGroupNotSetException(plan.getStorageGroup().getFullPath());
+      }
       for (PartialPath storagePath : storageGroupPaths) {
         IoTDB.metaManager.setTTL(storagePath, plan.getDataTTL());
         StorageEngine.getInstance().setTTL(storagePath, plan.getDataTTL());
       }
+    } catch (StorageGroupNotSetException e) {
+      throw e;

Review comment:
       `StorageGroupNotSetException `extends from `MetadataException`, and `MManager `throws `MetadataException`.
   The `StorageGroupNotSetException `here will be caught by `MetadataException`. So individually catch and throw it.




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



[GitHub] [iotdb] wangchao316 commented on a change in pull request #5235: [IOTDB-2743] ttl cannot be set if storage group is not exist

Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235#discussion_r826670729



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -1496,14 +1496,20 @@ private void operateUnloadFile(OperateFilePlan plan) throws QueryProcessExceptio
     }
   }
 
-  private void operateTTL(SetTTLPlan plan) throws QueryProcessException {
+  private void operateTTL(SetTTLPlan plan)
+      throws QueryProcessException, StorageGroupNotSetException {
     try {
       List<PartialPath> storageGroupPaths =
           IoTDB.metaManager.getMatchedStorageGroups(plan.getStorageGroup(), plan.isPrefixMatch());
+      if (storageGroupPaths.isEmpty()) {
+        throw new StorageGroupNotSetException(plan.getStorageGroup().getFullPath());
+      }
       for (PartialPath storagePath : storageGroupPaths) {
         IoTDB.metaManager.setTTL(storagePath, plan.getDataTTL());
         StorageEngine.getInstance().setTTL(storagePath, plan.getDataTTL());
       }
+    } catch (StorageGroupNotSetException e) {
+      throw e;

Review comment:
       This don't need to catch here, just throw it.




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



[GitHub] [iotdb] HTHou commented on pull request #5235: ttl cannot be set if storage group is not exist

Posted by GitBox <gi...@apache.org>.
HTHou commented on pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235#issuecomment-1067583527


   Hi, create a jira issue and add some test about it?


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



[GitHub] [iotdb] cigarl commented on pull request #5235: [IOTDB-2743] ttl cannot be set if storage group is not exist

Posted by GitBox <gi...@apache.org>.
cigarl commented on pull request #5235:
URL: https://github.com/apache/iotdb/pull/5235#issuecomment-1067651127


   > Hi, create a jira issue and add some test about it?
   
   done. 
   PTAL~


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