You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Chung-En Lee (Jira)" <ji...@apache.org> on 2026/10/14 08:38:00 UTC

[jira] [Created] (HDDS-16994) RpcClient#createKeyIfNotExists checks the wrong OM version

Chung-En Lee created HDDS-16994:
-----------------------------------

             Summary: RpcClient#createKeyIfNotExists checks the wrong OM version
                 Key: HDDS-16994
                 URL: https://issues.apache.org/jira/browse/HDDS-16994
             Project: Apache Ozone
          Issue Type: Bug
            Reporter: Chung-En Lee


`RpcClient#createKeyIfNotExists` and `RpcClient#createStreamKeyIfNotExists}`check `OzoneManagerVersion.ATOMIC_REWRITE_KEY` before sending a CreateKey request with  `expectedDataGeneration = EXPECTED_GEN_CREATE_IF_ABSENT` (0). The OM only understands that value as of `ATOMIC_CREATE_IF_NOT_EXISTS` (12), added by HDDS-13963, and `OMKeyCreateRequest#preExecute}`checks exactly that version.

An OM at versions 6–11 passes the client-side check, but it treats generation 0 as an atomic rewrite:
* If the key does not exist, the request fails with `KEY_NOT_FOUND` ("Key not found during expected rewrite").
* If the key exists, its `updateID` is not 0, so the request fails with `KEY_NOT_FOUND` ("Generation mismatch during expected rewrite").

No data is overwritten, but the caller gets a misleading error. For example, an S3 PutObject with `If-None-Match: *` for a new key fails with a key-not-found error instead of reporting that the OM does not support the operation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org