sreejasahithi commented on PR #8453: URL: https://github.com/apache/ozone/pull/8453#issuecomment-2996428121
Currently, [validateAndNormalizeKey](https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java#L524) is used by both `OMKeyDeleteRequest` and `OMKeyCreateRequest`, which results in unnecessary key name validation during deletes operations. Since key name validation is not necessary during delete operations, because we should be able to delete any key that was allowed to be created. To address this, I propose introducing a separate method for normalizing key paths specifically for `OMKeyDeleteRequest`. This new method would perform key name validation (i.e invokes [isValidKeyPath](https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java#L550)) only if the configuration flag [keyNameCharacterCheckEnabled](https://github.com/apache/ozone/blob/master/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmConfig.java#L64) is set to true, thereby preserving the existing behavior. Other operations like create or rename can continue using the existing validateAndNormalizeKey flow without any changes. Alternatively, we could instead add a check for `keyNameCharacterCheckEnabled` directly inside [validateAndNormalizeKey](https://github.com/apache/ozone/blob/master/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/OMClientRequest.java#L539). However, this approach might affect all other operations that use this method. CC @adoroszlai , @sadanand48 , @ivandika3 , @SaketaChalamchala -- 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]
