Siyao Meng created HDDS-17299:
---------------------------------

             Summary: Return INVALID_REQUEST for invalid replication config in 
OM bucket property and key create requests
                 Key: HDDS-17299
                 URL: https://issues.apache.org/jira/browse/HDDS-17299
             Project: Apache Ozone
          Issue Type: Bug
          Components: Ozone Manager
            Reporter: Siyao Meng


{{OMBucketSetPropertyRequest}} and {{OMBucketSetOwnerRequest}} parse the 
bucket's default replication config ({{OmBucketArgs.getFromProtobuf}}) in 
{{validateAndUpdateCache}}, outside the request's error handling. An unknown EC 
codec or replication type EC without an EC config fails with 
{{IllegalArgumentException}} or {{UnsupportedOperationException}} instead of an 
{{OMException}} with a result code. The same happens for a multipart 
{{CreateKey}} (whose {{preExecute}} resolves the replication config only for 
non-multipart keys) and for {{CreateDirectory}} in OBS and LEGACY buckets.

This change:
* validates the default replication config in {{preExecute}} of the bucket 
property requests, as {{OMBucketCreateRequest}} already does, and rejects 
invalid ones with {{INVALID_REQUEST}}
* parses it inside the request's error handling in {{validateAndUpdateCache}}
* maps parse failures in {{OzoneConfigUtil.resolveReplicationConfigPreference}} 
to {{INVALID_REQUEST}} and uses it for directory key info

Compatibility:
* The Ozone client only sends known codecs, so it sees no difference.
* No protocol, version or layout change.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to