Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
This is a negative scenario that was tested
While modifying setquota NameSpacequota we should have a check on usedNamespace already consumed by the volume.
For Example these are the two possible scenarios:
- In a case when namespace quota is not defined on the volume and there are some n numbers of buckets already created in that volume. Then if we are trying to setquota on that volume, there should be a check that it should not allow us to set a namespacequota less than usedNamespace
- Second similiar scenario is Create volume with namespace quota --> create buckets --> Clear namespace quota --> Assign namespace quota less than already created buckets
PFB the steps to recreate Scenario 1 :
Step 1 - Create volume without namespace quota
[root@quasar-tvqwpy-1 ~]# ozone sh volume create volume3 23/04/04 04:49:13 INFO rpc.RpcClient: Creating Volume: volume3, with hdfs as owner and space quota set to -1 bytes, counts quota set to -1
Step 2 - Check volume info
[root@quasar-tvqwpy-1 ~]# ozone sh volume info /volume3 { "metadata" : { }, "name" : "volume3", "admin" : "hdfs", "owner" : "hdfs", "quotaInBytes" : -1, "quotaInNamespace" : -1, "usedNamespace" : 0, "creationTime" : "2023-04-04T04:49:13.520Z", "modificationTime" : "2023-04-04T04:49:13.520Z", "acls" : [ { "type" : "USER", "name" : "hdfs", "aclScope" : "ACCESS", "aclList" : [ "ALL" ] }, { "type" : "GROUP", "name" : "hdfs", "aclScope" : "ACCESS", "aclList" : [ "ALL" ] }, { "type" : "GROUP", "name" : "hadoop", "aclScope" : "ACCESS", "aclList" : [ "ALL" ] } ], "refCount" : 0 }
Step 3 - Create buckets
[root@quasar-tvqwpy-1 ~]# ozone sh bucket create /volume3/bucket1 23/04/04 04:49:44 INFO rpc.RpcClient: Creating Bucket: volume3/bucket1, with server-side default bucket layout, hdfs as owner, Versioning false, Storage Type set to DISK and Encryption set to false [root@quasar-tvqwpy-1 ~]# ozone sh bucket create /volume3/bucket2 23/04/04 04:49:50 INFO rpc.RpcClient: Creating Bucket: volume3/bucket2, with server-side default bucket layout, hdfs as owner, Versioning false, Storage Type set to DISK and Encryption set to false [root@quasar-tvqwpy-1 ~]# ozone sh bucket create /volume3/bucket3 23/04/04 04:49:56 INFO rpc.RpcClient: Creating Bucket: volume3/bucket3, with server-side default bucket layout, hdfs as owner, Versioning false, Storage Type set to DISK and Encryption set to false [root@quasar-tvqwpy-1 ~]# ozone fs -ls ofs://ozone1/volume3 Found 3 items drwxrwxrwx - hdfs hdfs 0 2023-04-04 04:49 ofs://ozone1/volume3/bucket1 drwxrwxrwx - hdfs hdfs 0 2023-04-04 04:49 ofs://ozone1/volume3/bucket2 drwxrwxrwx - hdfs hdfs 0 2023-04-04 04:49 ofs://ozone1/volume3/bucket3
Step 4 - setquota [This must have failed]
[root@quasar-tvqwpy-1 ~]# ozone sh volume setquota --namespace-quota 1 /volume3
Step 5 - Verify
[root@quasar-tvqwpy-1 ~]# ozone sh volume info /volume3 { "metadata" : { }, "name" : "volume3", "admin" : "hdfs", "owner" : "hdfs", "quotaInBytes" : -1, "quotaInNamespace" : 1, "usedNamespace" : 3, "creationTime" : "2023-04-04T04:49:13.520Z", "modificationTime" : "2023-04-04T04:50:32.568Z", "acls" : [ { "type" : "USER", "name" : "hdfs", "aclScope" : "ACCESS", "aclList" : [ "ALL" ] }, { "type" : "GROUP", "name" : "hdfs", "aclScope" : "ACCESS", "aclList" : [ "ALL" ] }, { "type" : "GROUP", "name" : "hadoop", "aclScope" : "ACCESS", "aclList" : [ "ALL" ] } ], "refCount" : 0 }
Attachments
Issue Links
- links to