GeorgeJahad opened a new pull request, #3543:
URL: https://github.com/apache/ozone/pull/3543

   ## What changes were proposed in this pull request?
   
   
   
   A member of our dev ops team discovered that setting a quota on a non legacy 
bucket will convert it to a legacy bucket, making the data there inaccessible.
   
   You can reproduce the problem like so:
   ```
   ozone sh volume create testgbj
   ozone sh bucket create -l FILE_SYSTEM_OPTIMIZED testgbj/fsobucket4
   ozone sh bucket info testgbj/fsobucket4
   {
     "metadata" : { },
     "volumeName" : "testgbj",
     "name" : "fsobucket4",
     "storageType" : "DISK",
     "versioning" : false,
     "usedBytes" : 0,
     "usedNamespace" : 0,
     "creationTime" : "2022-06-23T21:26:47.091Z",
     "modificationTime" : "2022-06-23T21:26:47.091Z",
     "quotaInBytes" : -1,
     "quotaInNamespace" : -1,
     "bucketLayout" : "FILE_SYSTEM_OPTIMIZED",
     "owner" : "root",
     "link" : false
   }
   
   ozone sh bucket setquota --namespace-quota=20 testgbj/fsobucket4
   
   {{{}}
     "metadata" : { },
     "volumeName" : "testgbj",
     "name" : "fsobucket4",
     "storageType" : "DISK",
     "versioning" : false,
     "usedBytes" : 0,
     "usedNamespace" : 0,
     "creationTime" : "2022-06-23T21:26:47.091Z",
     "modificationTime" : "2022-06-23T21:27:48.255Z",
     "quotaInBytes" : -1,
     "quotaInNamespace" : 20,
     "bucketLayout" : "LEGACY",
     "replicationConfig" : {
       "replicationFactor" : "ONE",
       "requiredNodes" : 1,
       "replicationType" : "RATIS"
     },
     "link" : false
   }
   ```
    
   
   The problem is that validateAndUpdateCache() method in 
OMBucketSetPropertyRequest.java creates a copy of the OmBucketInfo with the new 
property set, but leaves the bucket layout as the default, instead of copying 
it over.
   
   Fix appears to be just to set the layout explicitly.
   
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-6941
   
   ## How was this patch tested?
   
   added 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to