XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • None

    Description

      Currently setting Quota is invalid if set to 0. It's actually going to be set to -1.

      store.getVolume(volumeName).getBucket(bucketName).setQuota(
              OzoneQuota.parseQuota("0GB", 0));
          Assert.assertEquals(-1, bucket.getQuotaInBytes());
          Assert.assertEquals(-1, bucket.getQuotaInNamespace());
      

      This behavior is actually incorrect, and In general setting quota to 0 isn't a valid entry even in HDFS. we can be consistent with HDFS on this part.:

      java.lang.IllegalArgumentException: Invalid values for quota : 0
      

      This problem occurs because the original client quota type is long. If the user does not specify quota, the default value for this field is 0.
      A backend validation fails to verify that the user did not specify quota or set quoat to 0, since both actions are passed to the backend to be 0.
      So it would be more appropriate to change the long to a string. If the user does not specify quota, it is null. It's easier to judge.

      Attachments

        Issue Links

          Activity

            People

              micahzhao mingchao zhao
              micahzhao mingchao zhao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: