You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/09/18 01:41:13 UTC

[GitHub] [ozone] JacksonYao287 opened a new pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

JacksonYao287 opened a new pull request #2659:
URL: https://github.com/apache/ozone/pull/2659


   ## What changes were proposed in this pull request?
   
   failed with exception
   java.lang.IllegalArgumentException: Total buckets quota in this volume should not be greater than volume quota : the total space quota is set to:256000. But the volume space quota is:102400
   at org.apache.hadoop.ozone.om.request.bucket.OMBucketSetPropertyRequest.checkQuotaBytesValid(OMBucketSetPropertyRequest.java:281)
   at org.apache.hadoop.ozone.om.request.bucket.OMBucketSetPropertyRequest.validateAndUpdateCache(OMBucketSetPropertyRequest.java:172)
   at org.apache.hadoop.ozone.protocolPB.OzoneManagerRequestHandler.handleWriteRequest(OzoneManagerRequestHandler.java:246)
   at org.apache.hadoop.ozone.om.ratis.OzoneManagerStateMachine.runCommand(OzoneManagerStateMachine.java:472)
   at org.apache.hadoop.ozone.om.ratis.OzoneManagerStateMachine.lambda$2(OzoneManagerStateMachine.java:291)
   at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   at java.lang.Thread.run(Thread.java:748)
   2021-09-17 19:50:35,317 [shutdown-hook-0] INFO org.apache.hadoop.ozone.om.OzoneManagerStarter: SHUTDOWN_MSG:
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5761
   
   ## How was this patch tested?
   unit test
   


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JacksonYao287 commented on pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#issuecomment-923467977


   @bharatviswa504 @ayushtkn thank you for the review!


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JacksonYao287 commented on pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#issuecomment-922210932


   @ayushtkn thanks for the review, i will modify current tests to cover this issue


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#discussion_r711791312



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -310,9 +310,11 @@ private static OMClientRequest getOMAclRequest(OMRequest omRequest) {
    * @param exception
    * @return OzoneManagerProtocolProtos.Status
    */
-  public static Status exceptionToResponseStatus(IOException exception) {
+  public static Status exceptionToResponseStatus(Exception exception) {
     if (exception instanceof OMException) {
       return Status.values()[((OMException) exception).getResult().ordinal()];
+    } else if (exception instanceof IllegalArgumentException) {

Review comment:
       To explain more we should throw OMException with Status code QUOTA_EXCEEDED, instead of 
   
   throw new IllegalArgumentException("Total buckets quota in this volume " +
             "should not be greater than volume quota : the total space quota is" +
             " set to:" + totalBucketQuota + ". But the volume space quota is:" +
             volumeQuotaInBytes); 
   
   We should use OMException here. Like how we handle any other error related to request logic.




-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 merged pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
bharatviswa504 merged pull request #2659:
URL: https://github.com/apache/ozone/pull/2659


   


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#issuecomment-923179231


   @ayushtkn I missed your comments, looks like tests are fixed with latest code changes. If any, we can open a new Jira and fix this.


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#issuecomment-923178432


   Thank You @JacksonYao287 for catching this bug and fixing this.
   


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 edited a comment on pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
bharatviswa504 edited a comment on pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#issuecomment-923179231


   @ayushtkn I missed your comments, looks like tests are fixed with latest code changes. If any more comments, we can open a new Jira and fix them.


-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JacksonYao287 commented on pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#issuecomment-922251014


   @ChenSammi @ayushtkn  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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bharatviswa504 commented on a change in pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
bharatviswa504 commented on a change in pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#discussion_r711790848



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -310,9 +310,11 @@ private static OMClientRequest getOMAclRequest(OMRequest omRequest) {
    * @param exception
    * @return OzoneManagerProtocolProtos.Status
    */
-  public static Status exceptionToResponseStatus(IOException exception) {
+  public static Status exceptionToResponseStatus(Exception exception) {
     if (exception instanceof OMException) {
       return Status.values()[((OMException) exception).getResult().ordinal()];
+    } else if (exception instanceof IllegalArgumentException) {

Review comment:
       IMHO instead of changing here, the validateAndUpdateCache should not throw IllegalArgumentException and throw an OMException and set that as response status using createErrorOMResponse(omResponse, exception)
   
   In general validateAndUpdateCache should not throw any RunTimeExceptions, and it should handle errors and generate response. 




-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] JacksonYao287 commented on a change in pull request #2659: HDDS-5761. should not shutdown om when setting a bigger bucket quota than volume quota

Posted by GitBox <gi...@apache.org>.
JacksonYao287 commented on a change in pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#discussion_r712057483



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -310,9 +310,11 @@ private static OMClientRequest getOMAclRequest(OMRequest omRequest) {
    * @param exception
    * @return OzoneManagerProtocolProtos.Status
    */
-  public static Status exceptionToResponseStatus(IOException exception) {
+  public static Status exceptionToResponseStatus(Exception exception) {
     if (exception instanceof OMException) {
       return Status.values()[((OMException) exception).getResult().ordinal()];
+    } else if (exception instanceof IllegalArgumentException) {

Review comment:
       yea, make sense, i will do this in a new commit




-- 
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: issues-unsubscribe@ozone.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org