Chu Cheng Li created HDDS-15184:
-----------------------------------

             Summary: Atomic Create-If-Absent Should Use 0 for Generation Match
                 Key: HDDS-15184
                 URL: https://issues.apache.org/jira/browse/HDDS-15184
             Project: Apache Ozone
          Issue Type: Sub-task
          Components: OM, s3gateway
            Reporter: Chu Cheng Li
            Assignee: Chu Cheng Li


We currently use an expected data generation of -1 to represent “create if 
absent”. In contrast, GCS uses {{--if-generation-match=0}} for its 
create-if-absent semantics.

One potential concern is whether the first object we create in Ozone could have 
a generation/update ID of 0, which would conflict with this encoding. In 
practice, this does not happen: committed keys in Ozone derive their 
{{updateID}} from the Ratis transaction index at commit time 
({{{}OMKeyCommitRequest.java{}}}, around line 344). The very first Ratis index 
(0) is reserved for startup/configuration log state before any client writes, 
so actual OM write requests always receive positive indices. As a result, 
committed keys will never have {{{}updateID == 0{}}}, and using 0 to encode 
“absent” is safe.



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

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

Reply via email to