ambry icon indicating copy to clipboard operation
ambry copied to clipboard

Detect conflict during named blob put operation before upload or stitch operation.

Open ankagrawal opened this issue 1 year ago • 1 comments

If the upload or stitch operation of a named blob is done without x-ambry-named-upsert header set to true, then update to the named blob is not allowed, and Ambry should return http 409 Conflict error code. When handling such requests, its efficient to first check for a conflict, and then do the work of saving the blob to storage node. This PR makes the change to first check for conflict, and do the upload only if there is no conflict.

ankagrawal avatar Feb 01 '24 22:02 ankagrawal

Codecov Report

Attention: Patch coverage is 53.33333% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 31.88%. Comparing base (52ba813) to head (1d98605). Report is 3 commits behind head on master.

Files Patch % Lines
...github/ambry/frontend/AmbryIdConverterFactory.java 61.11% 8 Missing and 6 partials :warning:
...com/github/ambry/frontend/NamedBlobPutHandler.java 30.00% 11 Missing and 3 partials :warning:
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #2704       +/-   ##
=============================================
- Coverage     64.24%   31.88%   -32.37%     
+ Complexity    10398     5348     -5050     
=============================================
  Files           840      840               
  Lines         71755    71822       +67     
  Branches       8611     8621       +10     
=============================================
- Hits          46099    22898    -23201     
- Misses        23004    47146    +24142     
+ Partials       2652     1778      -874     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Feb 01 '24 22:02 codecov-commenter