peterxcli opened a new pull request, #10201:
URL: https://github.com/apache/ozone/pull/10201

   ## What changes were proposed in this pull request?
   
   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.
   > 
https://docs.cloud.google.com/storage/docs/xml-api/reference-headers#xgoogifgenerationmatch
   > If you set the x-goog-if-generation-match header to 0, Cloud Storage only 
performs the specified request if the object does not currently exist. For 
example, you can perform a PUT request to create a new object with a 
x-goog-if-generation-match, and the object will only get created if it doesn't 
already exist as a live version. If the object exists, the request is aborted.
   
   
   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. 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.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15184
   
   ## How was this patch tested?
   
   existing test


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

Reply via email to