George Jahad created HDDS-6941:
----------------------------------
Summary: Setting Bucket Proproperty can corrupt bucket layout
Key: HDDS-6941
URL: https://issues.apache.org/jira/browse/HDDS-6941
Project: Apache Ozone
Issue Type: Improvement
Reporter: George Jahad
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 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.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]