Page MenuHomePhabricator

[services][blob] Handle getting blob data
ClosedPublic

Authored by bartek on Nov 22 2022, 12:58 AM.
Tags
None
Referenced Files
F1697035: D5701.diff
Fri, May 3, 4:27 PM
Unknown Object (File)
Thu, May 2, 12:32 AM
Unknown Object (File)
Tue, Apr 23, 9:22 AM
Unknown Object (File)
Tue, Apr 23, 9:22 AM
Unknown Object (File)
Tue, Apr 23, 9:22 AM
Unknown Object (File)
Tue, Apr 23, 9:22 AM
Unknown Object (File)
Tue, Apr 23, 9:22 AM
Unknown Object (File)
Tue, Apr 23, 9:22 AM
Subscribers

Details

Summary

Implemented basic logic for the Get RPC call.

C++ counterpart

Depends on D5700

Test Plan
  1. Create a blob using e.g. the C++ blob service (or in any other way)
  2. Get the blob data with the Rust implementation
  3. If the data is small, modify chunk_size to some small value to test if multiple parts are returned as expected

Diff Detail

Repository
rCOMM Comm
Branch
barthap/blob-rust
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Nov 22 2022, 10:18 AM
varun requested changes to this revision.Nov 23 2022, 12:36 AM
varun added inline comments.
services/blob/src/service.rs
103 ↗(On Diff #18725)

what's happening here?

135 ↗(On Diff #18725)

Same feedback as previous diff about keeping the Status message brief and generic

This revision now requires changes to proceed.Nov 23 2022, 12:36 AM

Made response errors vague, tried to make code a bit more readable

One question inline

services/blob/src/service.rs
90 ↗(On Diff #18813)

Do you think we should do some validation on the value returned by content_length before we take the absolute value?

This revision is now accepted and ready to land.Nov 28 2022, 11:31 PM
services/blob/src/service.rs
90 ↗(On Diff #18813)

Good catch, I can do sth like this:

let file_size: u64 = object_metadata.content_length().try_into().map_err(|err| {
  error!("Invalid content length: {:?}", err);
  Status::aborted("server error")
})?;
  • Rebase
  • Validate received content length
This revision was automatically updated to reflect the committed changes.