Chung-En Lee created HDDS-17754:
-----------------------------------

             Summary: Remove OzoneManager#checkFeatureEnabled calls that no 
test disables
                 Key: HDDS-17754
                 URL: https://issues.apache.org/jira/browse/HDDS-17754
             Project: Apache Ozone
          Issue Type: Task
            Reporter: Chung-En Lee


HDDS-11378 added the private config {{ozone.om.features.disabled}} (not in 
{{ozone-default.xml}}) and {{OzoneManager#checkFeatureEnabled}}, so that a test 
can make OM reject a feature it otherwise supports.

Only {{ATOMIC_REWRITE_KEY}} is disabled anywhere: 
{{compose/compatibility/docker-config}} and {{compatibility/om.robot}}. Unit 
tests mock {{OzoneManager}}, so the call does nothing there.

No test disables {{S3_IF_NONE_MATCH_ETAG}} or {{ATOMIC_CREATE_IF_NOT_EXISTS}}, 
yet production code checks them in 4 places:
* {{OMKeyCreateRequest}}: {{S3_IF_NONE_MATCH_ETAG}}, 
{{ATOMIC_CREATE_IF_NOT_EXISTS}}
* {{OMKeyCommitRequest}}: {{ATOMIC_CREATE_IF_NOT_EXISTS}}
* {{S3MultipartUploadCompleteRequest}}: {{S3_IF_NONE_MATCH_ETAG}}

New changes keep copying the pattern (HDDS-16734, HDDS-17664), as if every new 
OM version needed this check. That confuses developers. The method reads only 
the config, not the apparent version, so it is not a version gate.

Proposal:
* Do not add new call sites.
* Remove the call sites that no test disables.
* Add javadoc saying {{checkFeatureEnabled}} is a test hook, not a version gate.



--
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