andyhuangdev opened a new pull request, #11531: URL: https://github.com/apache/ozone/pull/11531
## What changes were proposed in this pull request? RpcClient#createKeyIfNotExists and createStreamKeyIfNotExists currently check ATOMIC_REWRITE_KEY (OM version 6), although create-if-not-exists semantics require ATOMIC_CREATE_IF_NOT_EXISTS (version 12). This allows requests with expectedDataGeneration = 0 to reach OMs at versions 6–11, which interpret them as atomic rewrites and return misleading KEY_NOT_FOUND errors. For example, an S3 PutObject with If-None-Match: * for a new key fails instead of reporting that the operation is unsupported. The patch updates both client checks to require ATOMIC_CREATE_IF_NOT_EXISTS, adds regression tests for both APIs across known OM versions, and aligns the existing create-if-not-exists integration test feature checks. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16994 ## How was this patch tested? - Before the fix, the regression tests produced 12 expected failures for OM versions 6–11 across both APIs. - After the fix, all 74 TestRpcClient cases passed. Tests verify that unsupported versions are rejected before sending a CreateKey RPC and supported versions explicitly send generation 0. - Both create-if-not-exists methods in TestOzoneRpcClient passed across three bucket layouts: 6 cases total. - The repository checkstyle script and git diff --check passed. -- 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]
