Page MenuHomePhabricator

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

Authored by bartek on Apr 17 2023, 6:05 AM.
Tags
None
Referenced Files
F2186595: D7465.id.diff
Thu, Jul 4, 3:34 AM
Unknown Object (File)
Tue, Jul 2, 10:15 PM
Unknown Object (File)
Mon, Jul 1, 11:17 PM
Unknown Object (File)
Mon, Jul 1, 1:49 AM
Unknown Object (File)
Sun, Jun 30, 3:02 AM
Unknown Object (File)
Fri, Jun 14, 8:04 AM
Unknown Object (File)
Fri, Jun 14, 6:49 AM
Unknown Object (File)
Thu, Jun 13, 7:54 PM
Subscribers

Details

Summary

Resolves ENG-3522

Added implementation of the GET /blob/{holder} endpoint. The implementation is very similar to the Get blob RPC endpoint.

Depends on D7464

Test Plan

Created a blob larger than 5MB through gRPC API and called this endpoint using Postman. Ensured the response is correct.
Checked if HTTP 404 is returned when blob doesn't exist.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Apr 18 2023, 12:06 AM
jon requested changes to this revision.Apr 18 2023, 8:13 AM
jon added inline comments.
services/blob/src/http/handlers/blob.rs
48–52 ↗(On Diff #25216)

If we have the data local to the blob service, I think this makes sense.

However, having to stream some bytes from a s3 service to the blob service, then re-emit them to the client seems like a lot of I/O pressure on the blob service.

Are we able to do something like https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html where we can just pass the client a non-shareable but usable url?

services/blob/src/http/mod.rs
16–17 ↗(On Diff #25216)

if it has public visibility, should be able to remove the allow(unused).

May need to add pub at the mod level as well.

This revision now requires changes to proceed.Apr 18 2023, 8:13 AM
bartek added inline comments.
services/blob/src/http/handlers/blob.rs
48–52 ↗(On Diff #25216)

I considered pre-signed URLs initially but wanted to avoid exposing them by blob service. Moreover, this complicates both client-side (two calls instead of one) and requires additional configuration on blob service side.
Changing the approach now means that the whole stack goes to trash.

services/blob/src/http/mod.rs
16–17 ↗(On Diff #25216)

The pub would expose this outside handlers module which I don't want. The unused is for handle_db_error which is used in the next diff

jon added inline comments.
services/blob/src/http/handlers/blob.rs
48–52 ↗(On Diff #25216)

Fair enough, seems like you considered it.

services/blob/src/http/mod.rs
16–17 ↗(On Diff #25216)

sounds good

This revision is now accepted and ready to land.Apr 18 2023, 10:08 AM