Page MenuHomePhabricator

[services][blob] Implement Delete blob HTTP handler
ClosedPublic

Authored by bartek on Apr 17 2023, 6:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 3, 3:33 PM
Unknown Object (File)
Mon, Jul 1, 12:39 AM
Unknown Object (File)
Sun, Jun 30, 7:25 PM
Unknown Object (File)
Sun, Jun 30, 2:02 PM
Unknown Object (File)
Sun, Jun 30, 1:33 PM
Unknown Object (File)
Sat, Jun 29, 10:34 PM
Unknown Object (File)
Wed, Jun 26, 10:40 AM
Unknown Object (File)
Wed, Jun 26, 9:06 AM
Subscribers

Details

Summary

Resolves ENG-3524

THis diff implements the DELETE /blob/{holder} endpoint which revokes a blob holder. If last holder is revoked, the blob is deleted. This behavior is the same as for Remove blob RPC.

Depends on D7465

Test Plan

Created a blob with a few holders and called this endpoint to remove them one by one.
Calling GET before returns HTTP 200, after deleting returns HTTP 404 as expected.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
services/blob/src/http/handlers/blob.rs
93–95 ↗(On Diff #25217)
bartek published this revision for review.Apr 18 2023, 12:07 AM
services/blob/src/http/handlers/blob.rs
118 ↗(On Diff #25217)

For debugging, this might be nice. Will probably need to borrow / clone &blob_hash earlier.

If this always expected to be empty, we should probably emit the error.

tomek added inline comments.
services/blob/src/http/handlers/blob.rs
96–111 ↗(On Diff #25217)

It is theoretically possible for someone to add a new holder between these operations. This is an edge case and fixing it won't be easy.

This revision is now accepted and ready to land.Apr 19 2023, 2:03 AM
services/blob/src/http/handlers/blob.rs
96–111 ↗(On Diff #25217)

Yes, unfortunately there is a possibility.

118 ↗(On Diff #25217)

Good idea for the debug! here.

If this always expected to be empty, we should probably emit the error.

No, if it's not empty, it means there are still references to the S3 object so we delete the reference (holder) only and not the object itself

Add debug log when S3 object is not deleted